To see the full tutorial from scratch, click here
minSdkVersion 24 deploymentTarget 13.0
- Set up Flutter and the Amplify CLI (follow the Project setup guide)
- Run
flutter pub getto install dependencies - Run
amplify initto initialize the Amplify project
- Confirm the default values for all questions
- Run
amplify add apito add a GraphQL API
- Select
GraphQLas the API type - Select
Amazon Cognito User Poolas the authentication type - Enable
conflict detectionand selectAuto Mergeas the resolution strategy - Select
Blank schemaas the schema template - Replace the contents of
amplify/backend/api/flutter_amplify_datastore/schema.graphqlwith the following schema:
type Workout @model @auth(rules: [{ allow: owner }]) {
id: ID!
owner: String @auth(rules: [{ allow: owner, operations: [read, delete] }])
createdAt: AWSDateTime!
startedAt: AWSDateTime
finishedAt: AWSDateTime
}- Run
amplify codegen modelsto generate models - Run
amplify add authto add authentication
- Select
Emailas the sign-in method
- Run
amplify pushto provision the backend - Run
flutter runto start the app