├── .gitignore ├── .metadata ├── .vscode ├── launch.json └── settings.json ├── README.md ├── amplify ├── .config │ └── project-config.json ├── backend │ ├── auth │ │ └── flutterauthdemo │ │ │ ├── flutterauthdemo-cloudformation-template.yml │ │ │ └── parameters.json │ ├── backend-config.json │ └── tags.json ├── cli.json └── team-provider-info.json ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── flutter_amplify_auth_demo │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-v21 │ │ │ └── launch_background.xml │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── values-night │ │ │ └── styles.xml │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── images ├── amazon-logo.png ├── facebook-logo.png └── google-logo.png ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Podfile ├── Podfile.lock ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── lib ├── amplifyconfiguration.dart ├── main.dart ├── models │ ├── app_user.dart │ ├── buttons_enum.dart │ ├── email_sign_in.dart │ └── validators.dart ├── pages │ ├── email_sign_in_page.dart │ ├── home_page.dart │ ├── landing_page.dart │ └── sign_in_page.dart └── widgets │ ├── email_sign_in_form.dart │ ├── show_error_dialog.dart │ └── sign_in_button.dart ├── media └── youtube.png ├── pubspec.lock ├── pubspec.yaml ├── test └── widget_test.dart └── web ├── favicon.png ├── icons ├── Icon-192.png └── Icon-512.png ├── index.html └── manifest.json /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Android Studio will place build artifacts here 44 | /android/app/debug 45 | /android/app/profile 46 | /android/app/release 47 | 48 | #amplify 49 | amplify/\#current-cloud-backend 50 | amplify/.config/local-* 51 | amplify/logs 52 | amplify/mock-data 53 | amplify/backend/amplify-meta.json 54 | amplify/backend/awscloudformation 55 | amplify/backend/.temp 56 | build/ 57 | dist/ 58 | node_modules/ 59 | aws-exports.js 60 | awsconfiguration.json 61 | amplifyconfiguration.json 62 | amplify-build-config.json 63 | amplify-gradle-config.json 64 | amplifytools.xcconfig 65 | .secret-* -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: b1395592de68cc8ac4522094ae59956dd21a91db 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "flutter Amplify Auth Demo", 9 | "request": "launch", 10 | "type": "dart" 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.exclude": { 3 | "amplify/.config": true, 4 | "amplify/**/*-parameters.json": true, 5 | "amplify/**/amplify.state": true, 6 | "amplify/**/transform.conf.json": true, 7 | "amplify/#current-cloud-backend": true, 8 | "amplify/backend/amplify-meta.json": true, 9 | "amplify/backend/awscloudformation": true 10 | } 11 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Reference Authentication Flow with Flutter & AWS Amplify 2 | 3 | 4 | YouTube video demo here: 5 | 6 | [![Authentication Flow with Flutter & AWS Amplify](media/youtube.png)](https://youtu.be/qe4Iw3Zfsqo) 7 | 8 | 9 | This project shows how to implement a full authentication flow in Flutter, using various AWS Amplify sign-in methods. 10 | 11 | 12 | ## Project goals 13 | 14 | This project shows how to: 15 | 16 | - use the various AWS Amplify sign-in methods 17 | - build a robust authentication flow 18 | - use appropriate state management techniques to separate UI, logic and authentication code 19 | - handle errors and present user-friendly error messages 20 | - write production-ready code following best practices 21 | 22 | 23 | Blog post: https://dev.to/offlineprogrammer/authentication-flow-with-flutter-aws-amplify-41fa 24 | 25 | 26 | ## [License: MIT](LICENSE.md) -------------------------------------------------------------------------------- /amplify/.config/project-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "providers": [ 3 | "awscloudformation" 4 | ], 5 | "projectName": "flutterauthdemo", 6 | "version": "3.1", 7 | "frontend": "flutter", 8 | "flutter": { 9 | "config": { 10 | "ResDir": "./lib/" 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /amplify/backend/auth/flutterauthdemo/flutterauthdemo-cloudformation-template.yml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | env: 5 | Type: String 6 | authRoleArn: 7 | Type: String 8 | unauthRoleArn: 9 | Type: String 10 | 11 | 12 | 13 | 14 | identityPoolName: 15 | Type: String 16 | 17 | 18 | 19 | allowUnauthenticatedIdentities: 20 | Type: String 21 | 22 | resourceNameTruncated: 23 | Type: String 24 | 25 | 26 | userPoolName: 27 | Type: String 28 | 29 | 30 | 31 | autoVerifiedAttributes: 32 | Type: CommaDelimitedList 33 | 34 | mfaConfiguration: 35 | Type: String 36 | 37 | 38 | 39 | mfaTypes: 40 | Type: CommaDelimitedList 41 | 42 | smsAuthenticationMessage: 43 | Type: String 44 | 45 | 46 | smsVerificationMessage: 47 | Type: String 48 | 49 | 50 | emailVerificationSubject: 51 | Type: String 52 | 53 | 54 | emailVerificationMessage: 55 | Type: String 56 | 57 | 58 | 59 | defaultPasswordPolicy: 60 | Type: String 61 | 62 | 63 | passwordPolicyMinLength: 64 | Type: Number 65 | 66 | 67 | passwordPolicyCharacters: 68 | Type: CommaDelimitedList 69 | 70 | 71 | requiredAttributes: 72 | Type: CommaDelimitedList 73 | 74 | 75 | userpoolClientGenerateSecret: 76 | Type: String 77 | 78 | 79 | userpoolClientRefreshTokenValidity: 80 | Type: Number 81 | 82 | 83 | userpoolClientWriteAttributes: 84 | Type: CommaDelimitedList 85 | 86 | 87 | userpoolClientReadAttributes: 88 | Type: CommaDelimitedList 89 | 90 | userpoolClientLambdaRole: 91 | Type: String 92 | 93 | 94 | 95 | userpoolClientSetAttributes: 96 | Type: String 97 | 98 | sharedId: 99 | Type: String 100 | 101 | 102 | resourceName: 103 | Type: String 104 | 105 | 106 | authSelections: 107 | Type: String 108 | 109 | 110 | 111 | 112 | serviceName: 113 | Type: String 114 | 115 | 116 | 117 | usernameAttributes: 118 | Type: CommaDelimitedList 119 | 120 | useDefault: 121 | Type: String 122 | 123 | 124 | 125 | userPoolGroups: 126 | Type: String 127 | 128 | 129 | userPoolGroupList: 130 | Type: CommaDelimitedList 131 | 132 | 133 | adminQueries: 134 | Type: String 135 | 136 | 137 | thirdPartyAuth: 138 | Type: String 139 | 140 | 141 | authProviders: 142 | Type: CommaDelimitedList 143 | 144 | 145 | hostedUI: 146 | Type: String 147 | 148 | hostedUIDomainName: 149 | Type: String 150 | 151 | 152 | 153 | authProvidersUserPool: 154 | Type: CommaDelimitedList 155 | 156 | hostedUIProviderMeta: 157 | Type: String 158 | 159 | 160 | oAuthMetadata: 161 | Type: String 162 | 163 | 164 | 165 | usernameCaseSensitive: 166 | Type: String 167 | 168 | 169 | dependsOn: 170 | Type: CommaDelimitedList 171 | 172 | hostedUIProviderCreds: 173 | Type: String 174 | 175 | 176 | 177 | Conditions: 178 | ShouldNotCreateEnvResources: !Equals [ !Ref env, NONE ] 179 | 180 | ShouldOutputAppClientSecrets: !Equals [!Ref userpoolClientGenerateSecret, true ] 181 | 182 | 183 | Resources: 184 | 185 | 186 | # BEGIN SNS ROLE RESOURCE 187 | SNSRole: 188 | # Created to allow the UserPool SMS Config to publish via the Simple Notification Service during MFA Process 189 | Type: AWS::IAM::Role 190 | Properties: 191 | RoleName: !If [ShouldNotCreateEnvResources, 'flutte574eac6c_sns-role', !Join ['',[ 'sns', '574eac6c', !Select [3, !Split ['-', !Ref 'AWS::StackName']], '-', !Ref env]]] 192 | AssumeRolePolicyDocument: 193 | Version: "2012-10-17" 194 | Statement: 195 | - Sid: "" 196 | Effect: "Allow" 197 | Principal: 198 | Service: "cognito-idp.amazonaws.com" 199 | Action: 200 | - "sts:AssumeRole" 201 | Condition: 202 | StringEquals: 203 | sts:ExternalId: flutte574eac6c_role_external_id 204 | Policies: 205 | - 206 | PolicyName: flutte574eac6c-sns-policy 207 | PolicyDocument: 208 | Version: "2012-10-17" 209 | Statement: 210 | - 211 | Effect: "Allow" 212 | Action: 213 | - "sns:Publish" 214 | Resource: "*" 215 | # BEGIN USER POOL RESOURCES 216 | UserPool: 217 | # Created upon user selection 218 | # Depends on SNS Role for Arn if MFA is enabled 219 | Type: AWS::Cognito::UserPool 220 | UpdateReplacePolicy: Retain 221 | Properties: 222 | UserPoolName: !If [ShouldNotCreateEnvResources, !Ref userPoolName, !Join ['',[!Ref userPoolName, '-', !Ref env]]] 223 | 224 | 225 | UsernameConfiguration: 226 | CaseSensitive: false 227 | 228 | Schema: 229 | 230 | - 231 | Name: email 232 | Required: true 233 | Mutable: true 234 | 235 | 236 | 237 | 238 | AutoVerifiedAttributes: !Ref autoVerifiedAttributes 239 | 240 | 241 | EmailVerificationMessage: !Ref emailVerificationMessage 242 | EmailVerificationSubject: !Ref emailVerificationSubject 243 | 244 | Policies: 245 | PasswordPolicy: 246 | MinimumLength: !Ref passwordPolicyMinLength 247 | RequireLowercase: true 248 | RequireNumbers: true 249 | RequireSymbols: true 250 | RequireUppercase: true 251 | 252 | UsernameAttributes: !Ref usernameAttributes 253 | 254 | MfaConfiguration: !Ref mfaConfiguration 255 | SmsVerificationMessage: !Ref smsVerificationMessage 256 | SmsAuthenticationMessage: !Ref smsAuthenticationMessage 257 | SmsConfiguration: 258 | SnsCallerArn: !GetAtt SNSRole.Arn 259 | ExternalId: flutte574eac6c_role_external_id 260 | 261 | 262 | UserPoolClientWeb: 263 | # Created provide application access to user pool 264 | # Depends on UserPool for ID reference 265 | Type: "AWS::Cognito::UserPoolClient" 266 | Properties: 267 | ClientName: flutte574eac6c_app_clientWeb 268 | 269 | RefreshTokenValidity: !Ref userpoolClientRefreshTokenValidity 270 | UserPoolId: !Ref UserPool 271 | DependsOn: UserPool 272 | UserPoolClient: 273 | # Created provide application access to user pool 274 | # Depends on UserPool for ID reference 275 | Type: "AWS::Cognito::UserPoolClient" 276 | Properties: 277 | ClientName: flutte574eac6c_app_client 278 | 279 | GenerateSecret: !Ref userpoolClientGenerateSecret 280 | RefreshTokenValidity: !Ref userpoolClientRefreshTokenValidity 281 | UserPoolId: !Ref UserPool 282 | DependsOn: UserPool 283 | # BEGIN USER POOL LAMBDA RESOURCES 284 | UserPoolClientRole: 285 | # Created to execute Lambda which gets userpool app client config values 286 | Type: 'AWS::IAM::Role' 287 | Properties: 288 | RoleName: !If [ShouldNotCreateEnvResources, !Ref userpoolClientLambdaRole, !Join ['',['upClientLambdaRole', '574eac6c', !Select [3, !Split ['-', !Ref 'AWS::StackName']], '-', !Ref env]]] 289 | AssumeRolePolicyDocument: 290 | Version: '2012-10-17' 291 | Statement: 292 | - Effect: Allow 293 | Principal: 294 | Service: 295 | - lambda.amazonaws.com 296 | Action: 297 | - 'sts:AssumeRole' 298 | DependsOn: UserPoolClient 299 | UserPoolClientLambda: 300 | # Lambda which gets userpool app client config values 301 | # Depends on UserPool for id 302 | # Depends on UserPoolClientRole for role ARN 303 | Type: 'AWS::Lambda::Function' 304 | Properties: 305 | Code: 306 | ZipFile: !Join 307 | - |+ 308 | - - 'const response = require(''cfn-response'');' 309 | - 'const aws = require(''aws-sdk'');' 310 | - 'const identity = new aws.CognitoIdentityServiceProvider();' 311 | - 'exports.handler = (event, context, callback) => {' 312 | - ' if (event.RequestType == ''Delete'') { ' 313 | - ' response.send(event, context, response.SUCCESS, {})' 314 | - ' }' 315 | - ' if (event.RequestType == ''Update'' || event.RequestType == ''Create'') {' 316 | - ' const params = {' 317 | - ' ClientId: event.ResourceProperties.clientId,' 318 | - ' UserPoolId: event.ResourceProperties.userpoolId' 319 | - ' };' 320 | - ' identity.describeUserPoolClient(params).promise()' 321 | - ' .then((res) => {' 322 | - ' response.send(event, context, response.SUCCESS, {''appSecret'': res.UserPoolClient.ClientSecret});' 323 | - ' })' 324 | - ' .catch((err) => {' 325 | - ' response.send(event, context, response.FAILED, {err});' 326 | - ' });' 327 | - ' }' 328 | - '};' 329 | Handler: index.handler 330 | Runtime: nodejs12.x 331 | Timeout: '300' 332 | Role: !GetAtt 333 | - UserPoolClientRole 334 | - Arn 335 | DependsOn: UserPoolClientRole 336 | UserPoolClientLambdaPolicy: 337 | # Sets userpool policy for the role that executes the Userpool Client Lambda 338 | # Depends on UserPool for Arn 339 | # Marked as depending on UserPoolClientRole for easier to understand CFN sequencing 340 | Type: 'AWS::IAM::Policy' 341 | Properties: 342 | PolicyName: flutte574eac6c_userpoolclient_lambda_iam_policy 343 | Roles: 344 | - !Ref UserPoolClientRole 345 | PolicyDocument: 346 | Version: '2012-10-17' 347 | Statement: 348 | - Effect: Allow 349 | Action: 350 | - 'cognito-idp:DescribeUserPoolClient' 351 | Resource: !GetAtt UserPool.Arn 352 | DependsOn: UserPoolClientLambda 353 | UserPoolClientLogPolicy: 354 | # Sets log policy for the role that executes the Userpool Client Lambda 355 | # Depends on UserPool for Arn 356 | # Marked as depending on UserPoolClientLambdaPolicy for easier to understand CFN sequencing 357 | Type: 'AWS::IAM::Policy' 358 | Properties: 359 | PolicyName: flutte574eac6c_userpoolclient_lambda_log_policy 360 | Roles: 361 | - !Ref UserPoolClientRole 362 | PolicyDocument: 363 | Version: 2012-10-17 364 | Statement: 365 | - Effect: Allow 366 | Action: 367 | - 'logs:CreateLogGroup' 368 | - 'logs:CreateLogStream' 369 | - 'logs:PutLogEvents' 370 | Resource: !Sub 371 | - arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:* 372 | - { region: !Ref "AWS::Region", account: !Ref "AWS::AccountId", lambda: !Ref UserPoolClientLambda} 373 | DependsOn: UserPoolClientLambdaPolicy 374 | UserPoolClientInputs: 375 | # Values passed to Userpool client Lambda 376 | # Depends on UserPool for Id 377 | # Depends on UserPoolClient for Id 378 | # Marked as depending on UserPoolClientLambdaPolicy for easier to understand CFN sequencing 379 | Type: 'Custom::LambdaCallout' 380 | Properties: 381 | ServiceToken: !GetAtt UserPoolClientLambda.Arn 382 | clientId: !Ref UserPoolClient 383 | userpoolId: !Ref UserPool 384 | DependsOn: UserPoolClientLogPolicy 385 | 386 | HostedUICustomResource: 387 | Type: 'AWS::Lambda::Function' 388 | Properties: 389 | Code: 390 | ZipFile: !Join 391 | - |+ 392 | - - 'const response = require(''cfn-response'');' 393 | - 'const aws = require(''aws-sdk'');' 394 | - 'const identity = new aws.CognitoIdentityServiceProvider();' 395 | - 'exports.handler = (event, context, callback) => {' 396 | - ' const userPoolId = event.ResourceProperties.userPoolId;' 397 | - ' const inputDomainName = event.ResourceProperties.hostedUIDomainName;' 398 | - ' let deleteUserPoolDomain = (domainName) => {' 399 | - ' let params = { Domain: domainName, UserPoolId: userPoolId };' 400 | - ' return identity.deleteUserPoolDomain(params).promise();' 401 | - ' };' 402 | - ' if (event.RequestType == ''Delete'') {' 403 | - ' deleteUserPoolDomain(inputDomainName)' 404 | - ' .then(() => {response.send(event, context, response.SUCCESS, {})})' 405 | - ' .catch((err) => { console.log(err); response.send(event, context, response.FAILED, {err}) });' 406 | - ' }' 407 | - ' if (event.RequestType == ''Update'' || event.RequestType == ''Create'') {' 408 | - ' let checkDomainAvailability = (domainName) => {' 409 | - ' let params = { Domain: domainName };' 410 | - ' return identity.describeUserPoolDomain(params).promise().then((res) => {' 411 | - ' if (res.DomainDescription && res.DomainDescription.UserPool) {' 412 | - ' return false;' 413 | - ' }' 414 | - ' return true;' 415 | - ' }).catch((err) => { return false; });' 416 | - ' };' 417 | - ' let createUserPoolDomain = (domainName) => {' 418 | - ' let params = { Domain: domainName, UserPoolId: userPoolId };' 419 | - ' return identity.createUserPoolDomain(params).promise();' 420 | - ' };' 421 | - ' identity.describeUserPool({UserPoolId: userPoolId }).promise().then((result) => {' 422 | - ' if (inputDomainName) {' 423 | - ' if (result.UserPool.Domain === inputDomainName) {' 424 | - ' return;' 425 | - ' } else {' 426 | - ' if (!result.UserPool.Domain) {' 427 | - ' return checkDomainAvailability(inputDomainName).then((isDomainAvailable) => {' 428 | - ' if (isDomainAvailable) {' 429 | - ' return createUserPoolDomain(inputDomainName);' 430 | - ' } else {' 431 | - ' throw new Error(''Domain not available'');' 432 | - ' }' 433 | - ' });' 434 | - ' } else {' 435 | - ' return checkDomainAvailability(inputDomainName).then((isDomainAvailable) => {' 436 | - ' if (isDomainAvailable) {' 437 | - ' return deleteUserPoolDomain(result.UserPool.Domain).then(() => createUserPoolDomain(inputDomainName));' 438 | - ' } else {' 439 | - ' throw new Error(''Domain not available'');' 440 | - ' }' 441 | - ' });' 442 | - ' }' 443 | - ' }' 444 | - ' } else {' 445 | - ' if (result.UserPool.Domain) {' 446 | - ' return deleteUserPoolDomain(result.UserPool.Domain);' 447 | - ' }' 448 | - ' }' 449 | - ' }).then(() => {response.send(event, context, response.SUCCESS, {})}).catch((err) => {' 450 | - ' console.log(err); response.send(event, context, response.FAILED, {err});' 451 | - ' });' 452 | - '}}' 453 | 454 | 455 | Handler: index.handler 456 | Runtime: nodejs12.x 457 | Timeout: '300' 458 | Role: !GetAtt 459 | - UserPoolClientRole 460 | - Arn 461 | DependsOn: UserPoolClientRole 462 | 463 | HostedUICustomResourcePolicy: 464 | Type: 'AWS::IAM::Policy' 465 | Properties: 466 | PolicyName: !Join ['-',[!Ref UserPool, 'hostedUI']] 467 | Roles: 468 | - !Ref UserPoolClientRole 469 | PolicyDocument: 470 | Version: '2012-10-17' 471 | Statement: 472 | - Effect: Allow 473 | Action: 474 | - 'cognito-idp:CreateUserPoolDomain' 475 | - 'cognito-idp:DescribeUserPool' 476 | - 'cognito-idp:DeleteUserPoolDomain' 477 | Resource: !GetAtt UserPool.Arn 478 | - Effect: Allow 479 | Action: 480 | - 'cognito-idp:DescribeUserPoolDomain' 481 | Resource: '*' 482 | DependsOn: HostedUICustomResource 483 | HostedUICustomResourceLogPolicy: 484 | Type: 'AWS::IAM::Policy' 485 | Properties: 486 | PolicyName: !Join ['-',[!Ref UserPool, 'hostedUILogPolicy']] 487 | Roles: 488 | - !Ref UserPoolClientRole 489 | PolicyDocument: 490 | Version: 2012-10-17 491 | Statement: 492 | - Effect: Allow 493 | Action: 494 | - 'logs:CreateLogGroup' 495 | - 'logs:CreateLogStream' 496 | - 'logs:PutLogEvents' 497 | Resource: !Sub 498 | - arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:* 499 | - { region: !Ref "AWS::Region", account: !Ref "AWS::AccountId", lambda: !Ref HostedUICustomResource} 500 | DependsOn: HostedUICustomResourcePolicy 501 | HostedUICustomResourceInputs: 502 | Type: 'Custom::LambdaCallout' 503 | Properties: 504 | ServiceToken: !GetAtt HostedUICustomResource.Arn 505 | userPoolId: !Ref UserPool 506 | hostedUIDomainName: !If [ShouldNotCreateEnvResources, !Ref hostedUIDomainName, !Join ['-',[!Ref hostedUIDomainName, !Ref env]]] 507 | DependsOn: HostedUICustomResourceLogPolicy 508 | 509 | 510 | 511 | HostedUIProvidersCustomResource: 512 | Type: 'AWS::Lambda::Function' 513 | Properties: 514 | Code: 515 | ZipFile: !Join 516 | - |+ 517 | - - 'const response = require(''cfn-response'');' 518 | - 'const aws = require(''aws-sdk'');' 519 | - 'const identity = new aws.CognitoIdentityServiceProvider();' 520 | - 'exports.handler = (event, context, callback) => {' 521 | - 'try{' 522 | - ' const userPoolId = event.ResourceProperties.userPoolId;' 523 | - ' let hostedUIProviderMeta = JSON.parse(event.ResourceProperties.hostedUIProviderMeta);' 524 | - ' let hostedUIProviderCreds = JSON.parse(event.ResourceProperties.hostedUIProviderCreds);' 525 | - ' if(hostedUIProviderCreds.length === 0) {' 526 | - ' response.send(event, context, response.SUCCESS, {});' 527 | - ' }' 528 | - ' if (event.RequestType == ''Delete'') {' 529 | - ' response.send(event, context, response.SUCCESS, {});' 530 | - ' }' 531 | - ' if (event.RequestType == ''Update'' || event.RequestType == ''Create'') {' 532 | - ' let getRequestParams = (providerName) => {' 533 | - ' let providerMetaIndex = hostedUIProviderMeta.findIndex((provider) => provider.ProviderName === providerName);' 534 | - ' let providerMeta = hostedUIProviderMeta[providerMetaIndex];' 535 | - ' let providerCredsIndex = hostedUIProviderCreds.findIndex((provider) => provider.ProviderName === providerName);' 536 | - ' let providerCreds = hostedUIProviderCreds[providerCredsIndex];' 537 | - ' let requestParams = {' 538 | - ' ProviderDetails: {' 539 | - ' ''client_id'': providerCreds.client_id,' 540 | - ' ''client_secret'': providerCreds.client_secret,' 541 | - ' ''authorize_scopes'': providerMeta.authorize_scopes' 542 | - ' },' 543 | - ' ProviderName: providerMeta.ProviderName,' 544 | - ' UserPoolId: userPoolId,' 545 | - ' AttributeMapping: providerMeta.AttributeMapping' 546 | - ' };' 547 | - ' return requestParams;' 548 | - ' };' 549 | - ' let createIdentityProvider = (providerName) => {' 550 | - ' let requestParams = getRequestParams(providerName);' 551 | - ' requestParams.ProviderType = requestParams.ProviderName;' 552 | - ' return identity.createIdentityProvider(requestParams).promise();' 553 | - ' };' 554 | - ' let updateIdentityProvider = (providerName) => {' 555 | - ' let requestParams = getRequestParams(providerName);' 556 | - ' return identity.updateIdentityProvider(requestParams).promise();' 557 | - ' };' 558 | - ' let deleteIdentityProvider = (providerName) => {' 559 | - ' let params = {ProviderName: providerName, UserPoolId: userPoolId};' 560 | - ' return identity.deleteIdentityProvider(params).promise();' 561 | - ' };' 562 | - ' let providerPromises = [];' 563 | - ' identity.listIdentityProviders({UserPoolId: userPoolId, MaxResults: 60}).promise()' 564 | - ' .then((result) => {' 565 | - ' let providerList = result.Providers.map(provider => provider.ProviderName);' 566 | - ' let providerListInParameters = hostedUIProviderMeta.map(provider => provider.ProviderName);' 567 | - ' hostedUIProviderMeta.forEach((providerMetadata) => {' 568 | - ' if(providerList.indexOf(providerMetadata.ProviderName) > -1) {' 569 | - ' providerPromises.push(updateIdentityProvider(providerMetadata.ProviderName));' 570 | - ' } else {' 571 | - ' providerPromises.push(createIdentityProvider(providerMetadata.ProviderName));' 572 | - ' }' 573 | - ' });' 574 | - ' providerList.forEach((provider) => {' 575 | - ' if(providerListInParameters.indexOf(provider) < 0) {' 576 | - ' providerPromises.push(deleteIdentityProvider(provider));' 577 | - ' }' 578 | - ' });' 579 | - ' return Promise.all(providerPromises);' 580 | - ' }).then(() => {response.send(event, context, response.SUCCESS, {})}).catch((err) => {' 581 | - ' console.log(err.stack); response.send(event, context, response.FAILED, {err})' 582 | - ' });' 583 | - ' } ' 584 | - ' } catch(err) { console.log(err.stack); response.send(event, context, response.FAILED, {err});};' 585 | - '} ' 586 | 587 | Handler: index.handler 588 | Runtime: nodejs12.x 589 | Timeout: '300' 590 | Role: !GetAtt 591 | - UserPoolClientRole 592 | - Arn 593 | DependsOn: UserPoolClientRole 594 | 595 | HostedUIProvidersCustomResourcePolicy: 596 | Type: 'AWS::IAM::Policy' 597 | Properties: 598 | PolicyName: !Join ['-',[!Ref UserPool, 'hostedUIProvider']] 599 | Roles: 600 | - !Ref UserPoolClientRole 601 | PolicyDocument: 602 | Version: '2012-10-17' 603 | Statement: 604 | - Effect: Allow 605 | Action: 606 | - 'cognito-idp:CreateIdentityProvider' 607 | - 'cognito-idp:UpdateIdentityProvider' 608 | - 'cognito-idp:ListIdentityProviders' 609 | - 'cognito-idp:DeleteIdentityProvider' 610 | Resource: !GetAtt UserPool.Arn 611 | DependsOn: HostedUIProvidersCustomResource 612 | 613 | HostedUIProvidersCustomResourceLogPolicy: 614 | Type: 'AWS::IAM::Policy' 615 | Properties: 616 | PolicyName: !Join ['-',[!Ref UserPool, 'hostedUIProviderLogPolicy']] 617 | Roles: 618 | - !Ref UserPoolClientRole 619 | PolicyDocument: 620 | Version: 2012-10-17 621 | Statement: 622 | - Effect: Allow 623 | Action: 624 | - 'logs:CreateLogGroup' 625 | - 'logs:CreateLogStream' 626 | - 'logs:PutLogEvents' 627 | Resource: !Sub 628 | - arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:* 629 | - { region: !Ref "AWS::Region", account: !Ref "AWS::AccountId", lambda: !Ref HostedUIProvidersCustomResource} 630 | DependsOn: HostedUIProvidersCustomResourcePolicy 631 | 632 | HostedUIProvidersCustomResourceInputs: 633 | Type: 'Custom::LambdaCallout' 634 | Properties: 635 | ServiceToken: !GetAtt HostedUIProvidersCustomResource.Arn 636 | userPoolId: !Ref UserPool 637 | hostedUIProviderMeta: !Ref hostedUIProviderMeta 638 | hostedUIProviderCreds: !Ref hostedUIProviderCreds 639 | DependsOn: HostedUIProvidersCustomResourceLogPolicy 640 | 641 | 642 | OAuthCustomResource: 643 | Type: 'AWS::Lambda::Function' 644 | Properties: 645 | Code: 646 | ZipFile: !Join 647 | - |+ 648 | - - 'const response = require(''cfn-response'');' 649 | - 'const aws = require(''aws-sdk'');' 650 | - 'const identity = new aws.CognitoIdentityServiceProvider();' 651 | - 'exports.handler = (event, context, callback) => {' 652 | - 'try{' 653 | - ' const userPoolId = event.ResourceProperties.userPoolId;' 654 | - ' let webClientId = event.ResourceProperties.webClientId;' 655 | - ' let nativeClientId = event.ResourceProperties.nativeClientId;' 656 | - ' let hostedUIProviderMeta = JSON.parse(event.ResourceProperties.hostedUIProviderMeta);' 657 | - ' let oAuthMetadata = JSON.parse(event.ResourceProperties.oAuthMetadata);' 658 | - ' let providerList = hostedUIProviderMeta.map(provider => provider.ProviderName);' 659 | - ' providerList.push(''COGNITO'');' 660 | - ' if (event.RequestType == ''Delete'') {' 661 | - ' response.send(event, context, response.SUCCESS, {});' 662 | - ' }' 663 | - ' if (event.RequestType == ''Update'' || event.RequestType == ''Create'') {' 664 | - ' let params = {' 665 | - ' UserPoolId: userPoolId,' 666 | - ' AllowedOAuthFlows: oAuthMetadata.AllowedOAuthFlows,' 667 | - ' AllowedOAuthFlowsUserPoolClient: true,' 668 | - ' AllowedOAuthScopes: oAuthMetadata.AllowedOAuthScopes,' 669 | - ' CallbackURLs: oAuthMetadata.CallbackURLs,' 670 | - ' LogoutURLs: oAuthMetadata.LogoutURLs,' 671 | - ' SupportedIdentityProviders: providerList' 672 | - ' };' 673 | - ' let updateUserPoolClientPromises = [];' 674 | - ' params.ClientId = webClientId;' 675 | - ' updateUserPoolClientPromises.push(identity.updateUserPoolClient(params).promise());' 676 | - ' params.ClientId = nativeClientId;' 677 | - ' updateUserPoolClientPromises.push(identity.updateUserPoolClient(params).promise());' 678 | - ' Promise.all(updateUserPoolClientPromises)' 679 | - ' .then(() => {response.send(event, context, response.SUCCESS, {})}).catch((err) => {' 680 | - ' console.log(err.stack); response.send(event, context, response.FAILED, {err});' 681 | - ' });' 682 | - ' }' 683 | - '} catch(err) { console.log(err.stack); response.send(event, context, response.FAILED, {err});};' 684 | - '}' 685 | 686 | Handler: index.handler 687 | Runtime: nodejs12.x 688 | Timeout: '300' 689 | Role: !GetAtt 690 | - UserPoolClientRole 691 | - Arn 692 | DependsOn: HostedUIProvidersCustomResourceInputs 693 | 694 | OAuthCustomResourcePolicy: 695 | Type: 'AWS::IAM::Policy' 696 | Properties: 697 | PolicyName: !Join ['-',[!Ref UserPool, 'OAuth']] 698 | Roles: 699 | - !Ref UserPoolClientRole 700 | PolicyDocument: 701 | Version: '2012-10-17' 702 | Statement: 703 | - Effect: Allow 704 | Action: 705 | - 'cognito-idp:UpdateUserPoolClient' 706 | Resource: !GetAtt UserPool.Arn 707 | DependsOn: OAuthCustomResource 708 | 709 | OAuthCustomResourceLogPolicy: 710 | Type: 'AWS::IAM::Policy' 711 | Properties: 712 | PolicyName: !Join ['-',[!Ref UserPool, 'OAuthLogPolicy']] 713 | Roles: 714 | - !Ref UserPoolClientRole 715 | PolicyDocument: 716 | Version: 2012-10-17 717 | Statement: 718 | - Effect: Allow 719 | Action: 720 | - 'logs:CreateLogGroup' 721 | - 'logs:CreateLogStream' 722 | - 'logs:PutLogEvents' 723 | Resource: !Sub 724 | - arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:* 725 | - { region: !Ref "AWS::Region", account: !Ref "AWS::AccountId", lambda: !Ref OAuthCustomResource} 726 | DependsOn: OAuthCustomResourcePolicy 727 | 728 | OAuthCustomResourceInputs: 729 | Type: 'Custom::LambdaCallout' 730 | Properties: 731 | ServiceToken: !GetAtt OAuthCustomResource.Arn 732 | userPoolId: !Ref UserPool 733 | hostedUIProviderMeta: !Ref hostedUIProviderMeta 734 | oAuthMetadata: !Ref oAuthMetadata 735 | webClientId: !Ref 'UserPoolClientWeb' 736 | nativeClientId: !Ref 'UserPoolClient' 737 | DependsOn: OAuthCustomResourceLogPolicy 738 | 739 | 740 | 741 | 742 | # BEGIN IDENTITY POOL RESOURCES 743 | 744 | 745 | IdentityPool: 746 | # Always created 747 | Type: AWS::Cognito::IdentityPool 748 | Properties: 749 | IdentityPoolName: !If [ShouldNotCreateEnvResources, 'testAuthIdentityPool', !Join ['',['testAuthIdentityPool', '__', !Ref env]]] 750 | 751 | CognitoIdentityProviders: 752 | - ClientId: !Ref UserPoolClient 753 | ProviderName: !Sub 754 | - cognito-idp.${region}.amazonaws.com/${client} 755 | - { region: !Ref "AWS::Region", client: !Ref UserPool} 756 | - ClientId: !Ref UserPoolClientWeb 757 | ProviderName: !Sub 758 | - cognito-idp.${region}.amazonaws.com/${client} 759 | - { region: !Ref "AWS::Region", client: !Ref UserPool} 760 | 761 | AllowUnauthenticatedIdentities: !Ref allowUnauthenticatedIdentities 762 | 763 | 764 | DependsOn: UserPoolClientInputs 765 | 766 | 767 | IdentityPoolRoleMap: 768 | # Created to map Auth and Unauth roles to the identity pool 769 | # Depends on Identity Pool for ID ref 770 | Type: AWS::Cognito::IdentityPoolRoleAttachment 771 | Properties: 772 | IdentityPoolId: !Ref IdentityPool 773 | Roles: 774 | unauthenticated: !Ref unauthRoleArn 775 | authenticated: !Ref authRoleArn 776 | DependsOn: IdentityPool 777 | 778 | 779 | Outputs : 780 | 781 | IdentityPoolId: 782 | Value: !Ref 'IdentityPool' 783 | Description: Id for the identity pool 784 | IdentityPoolName: 785 | Value: !GetAtt IdentityPool.Name 786 | 787 | 788 | HostedUIDomain: 789 | Value: !If [ShouldNotCreateEnvResources, !Ref hostedUIDomainName, !Join ['-',[!Ref hostedUIDomainName, !Ref env]]] 790 | 791 | 792 | OAuthMetadata: 793 | Value: !Ref oAuthMetadata 794 | 795 | 796 | UserPoolId: 797 | Value: !Ref 'UserPool' 798 | Description: Id for the user pool 799 | UserPoolName: 800 | Value: !Ref userPoolName 801 | AppClientIDWeb: 802 | Value: !Ref 'UserPoolClientWeb' 803 | Description: The user pool app client id for web 804 | AppClientID: 805 | Value: !Ref 'UserPoolClient' 806 | Description: The user pool app client id 807 | AppClientSecret: 808 | Value: !GetAtt UserPoolClientInputs.appSecret 809 | Condition: ShouldOutputAppClientSecrets 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | -------------------------------------------------------------------------------- /amplify/backend/auth/flutterauthdemo/parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "identityPoolName": "testAuthIdentityPool", 3 | "allowUnauthenticatedIdentities": false, 4 | "resourceNameTruncated": "flutte574eac6c", 5 | "userPoolName": "flutterauthdemo", 6 | "autoVerifiedAttributes": [ 7 | "email" 8 | ], 9 | "mfaConfiguration": "OFF", 10 | "mfaTypes": [ 11 | "SMS Text Message" 12 | ], 13 | "smsAuthenticationMessage": "Your authentication code is {####}", 14 | "smsVerificationMessage": "Your verification code is {####}", 15 | "emailVerificationSubject": "Forgot password code: {####}", 16 | "emailVerificationMessage": "Forgot password code: {####}", 17 | "defaultPasswordPolicy": false, 18 | "passwordPolicyMinLength": 8, 19 | "passwordPolicyCharacters": [ 20 | "Requires Lowercase", 21 | "Requires Numbers", 22 | "Requires Symbols", 23 | "Requires Uppercase" 24 | ], 25 | "requiredAttributes": [ 26 | "email" 27 | ], 28 | "userpoolClientGenerateSecret": false, 29 | "userpoolClientRefreshTokenValidity": 30, 30 | "userpoolClientWriteAttributes": [], 31 | "userpoolClientReadAttributes": [], 32 | "userpoolClientLambdaRole": "flutte574eac6c_userpoolclient_lambda_role", 33 | "userpoolClientSetAttributes": false, 34 | "sharedId": "574eac6c", 35 | "resourceName": "flutterauthdemo", 36 | "authSelections": "identityPoolAndUserPool", 37 | "authRoleArn": { 38 | "Fn::GetAtt": [ 39 | "AuthRole", 40 | "Arn" 41 | ] 42 | }, 43 | "unauthRoleArn": { 44 | "Fn::GetAtt": [ 45 | "UnauthRole", 46 | "Arn" 47 | ] 48 | }, 49 | "serviceName": "Cognito", 50 | "usernameAttributes": [ 51 | "email" 52 | ], 53 | "useDefault": "manual", 54 | "userPoolGroups": false, 55 | "userPoolGroupList": [], 56 | "adminQueries": false, 57 | "thirdPartyAuth": false, 58 | "authProviders": [], 59 | "hostedUI": true, 60 | "hostedUIDomainName": "h504ojo61g90", 61 | "authProvidersUserPool": [ 62 | "Facebook", 63 | "Google", 64 | "LoginWithAmazon" 65 | ], 66 | "hostedUIProviderMeta": "[{\"ProviderName\":\"Facebook\",\"authorize_scopes\":\"email,public_profile\",\"AttributeMapping\":{\"email\":\"email\",\"username\":\"id\"}},{\"ProviderName\":\"Google\",\"authorize_scopes\":\"openid email profile\",\"AttributeMapping\":{\"email\":\"email\",\"username\":\"sub\"}},{\"ProviderName\":\"LoginWithAmazon\",\"authorize_scopes\":\"profile profile:user_id\",\"AttributeMapping\":{\"email\":\"email\",\"username\":\"user_id\"}}]", 67 | "oAuthMetadata": "{\"AllowedOAuthFlows\":[\"code\"],\"AllowedOAuthScopes\":[\"phone\",\"email\",\"openid\",\"profile\",\"aws.cognito.signin.user.admin\"],\"CallbackURLs\":[\"myapp://\"],\"LogoutURLs\":[\"myapp://\"]}", 68 | "usernameCaseSensitive": false, 69 | "dependsOn": [] 70 | } -------------------------------------------------------------------------------- /amplify/backend/backend-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "auth": { 3 | "flutterauthdemo": { 4 | "service": "Cognito", 5 | "providerPlugin": "awscloudformation", 6 | "dependsOn": [], 7 | "customAuth": false 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /amplify/backend/tags.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Key": "user:Stack", 4 | "Value": "{project-env}" 5 | }, 6 | { 7 | "Key": "user:Application", 8 | "Value": "{project-name}" 9 | } 10 | ] -------------------------------------------------------------------------------- /amplify/cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "features": { 3 | "graphqltransformer": { 4 | "addmissingownerfields": true, 5 | "validatetypenamereservedwords": true, 6 | "useexperimentalpipelinedtransformer": false, 7 | "enableiterativegsiupdates": true, 8 | "secondarykeyasgsi": true, 9 | "skipoverridemutationinputtypes": true 10 | }, 11 | "frontend-ios": { 12 | "enablexcodeintegration": true 13 | }, 14 | "auth": { 15 | "enablecaseinsensitivity": true 16 | }, 17 | "codegen": { 18 | "useappsyncmodelgenplugin": true, 19 | "usedocsgeneratorplugin": true, 20 | "usetypesgeneratorplugin": true, 21 | "cleangeneratedmodelsdirectory": true, 22 | "retaincasestyle": true 23 | }, 24 | "appsync": { 25 | "generategraphqlpermissions": true 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /amplify/team-provider-info.json: -------------------------------------------------------------------------------- 1 | { 2 | "staging": { 3 | "awscloudformation": { 4 | "AuthRoleName": "amplify-flutterauthdemo-staging-215648-authRole", 5 | "UnauthRoleArn": "arn:aws:iam::279012124572:role/amplify-flutterauthdemo-staging-215648-unauthRole", 6 | "AuthRoleArn": "arn:aws:iam::279012124572:role/amplify-flutterauthdemo-staging-215648-authRole", 7 | "Region": "us-east-1", 8 | "DeploymentBucketName": "amplify-flutterauthdemo-staging-215648-deployment", 9 | "UnauthRoleName": "amplify-flutterauthdemo-staging-215648-unauthRole", 10 | "StackName": "amplify-flutterauthdemo-staging-215648", 11 | "StackId": "arn:aws:cloudformation:us-east-1:279012124572:stack/amplify-flutterauthdemo-staging-215648/27cb4100-97ec-11eb-ad49-12328959da6d", 12 | "AmplifyAppId": "d3hsotus6yrkqc" 13 | }, 14 | "categories": { 15 | "auth": { 16 | "flutterauthdemo": {} 17 | } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 30 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | defaultConfig { 36 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 37 | applicationId "com.example.flutter_amplify_auth_demo" 38 | minSdkVersion 16 39 | targetSdkVersion 30 40 | versionCode flutterVersionCode.toInteger() 41 | versionName flutterVersionName 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 59 | } 60 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 13 | 17 | 21 | 26 | 30 | 31 | 32 | 33 | 34 | 35 | 37 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/flutter_amplify_auth_demo/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.flutter_amplify_auth_demo 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:4.1.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip 7 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /images/amazon-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/images/amazon-logo.png -------------------------------------------------------------------------------- /images/facebook-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/images/facebook-logo.png -------------------------------------------------------------------------------- /images/google-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/images/google-logo.png -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | platform :ios, '13.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Amplify (1.8.0): 3 | - Amplify/Default (= 1.8.0) 4 | - Amplify/Default (1.8.0) 5 | - amplify_auth_cognito (0.0.1): 6 | - Amplify 7 | - amplify_core 8 | - AmplifyPlugins/AWSCognitoAuthPlugin 9 | - Flutter 10 | - ObjectMapper 11 | - amplify_core (0.0.1): 12 | - Flutter 13 | - amplify_flutter (0.0.1): 14 | - Amplify 15 | - amplify_core 16 | - AmplifyPlugins/AWSCognitoAuthPlugin 17 | - AWSPluginsCore 18 | - Flutter 19 | - AmplifyPlugins/AWSCognitoAuthPlugin (1.8.0): 20 | - AWSAuthCore (~> 2.23.3) 21 | - AWSCognitoIdentityProvider (~> 2.23.3) 22 | - AWSCognitoIdentityProviderASF (~> 2.23.3) 23 | - AWSCore (~> 2.23.3) 24 | - AWSMobileClient (~> 2.23.3) 25 | - AWSPluginsCore (= 1.8.0) 26 | - AWSAuthCore (2.23.3): 27 | - AWSCore (= 2.23.3) 28 | - AWSCognitoIdentityProvider (2.23.3): 29 | - AWSCognitoIdentityProviderASF (= 2.23.3) 30 | - AWSCore (= 2.23.3) 31 | - AWSCognitoIdentityProviderASF (2.23.3) 32 | - AWSCore (2.23.3) 33 | - AWSMobileClient (2.23.3): 34 | - AWSAuthCore (= 2.23.3) 35 | - AWSCognitoIdentityProvider (= 2.23.3) 36 | - AWSCognitoIdentityProviderASF (= 2.23.3) 37 | - AWSCore (= 2.23.3) 38 | - AWSPluginsCore (1.8.0): 39 | - Amplify (= 1.8.0) 40 | - AWSCore (~> 2.23.3) 41 | - Flutter (1.0.0) 42 | - ObjectMapper (4.2.0) 43 | 44 | DEPENDENCIES: 45 | - amplify_auth_cognito (from `.symlinks/plugins/amplify_auth_cognito/ios`) 46 | - amplify_core (from `.symlinks/plugins/amplify_core/ios`) 47 | - amplify_flutter (from `.symlinks/plugins/amplify_flutter/ios`) 48 | - Flutter (from `Flutter`) 49 | 50 | SPEC REPOS: 51 | trunk: 52 | - Amplify 53 | - AmplifyPlugins 54 | - AWSAuthCore 55 | - AWSCognitoIdentityProvider 56 | - AWSCognitoIdentityProviderASF 57 | - AWSCore 58 | - AWSMobileClient 59 | - AWSPluginsCore 60 | - ObjectMapper 61 | 62 | EXTERNAL SOURCES: 63 | amplify_auth_cognito: 64 | :path: ".symlinks/plugins/amplify_auth_cognito/ios" 65 | amplify_core: 66 | :path: ".symlinks/plugins/amplify_core/ios" 67 | amplify_flutter: 68 | :path: ".symlinks/plugins/amplify_flutter/ios" 69 | Flutter: 70 | :path: Flutter 71 | 72 | SPEC CHECKSUMS: 73 | Amplify: 550f9e628e68f829ee4d9daa802912ad3644cb96 74 | amplify_auth_cognito: 2e090a788d0ba4e08f6438170b1e7aac872782b4 75 | amplify_core: 8b38d20089fe4f225c14db6892f586bd03824a42 76 | amplify_flutter: d64b45e3a016e491bbb2e110fee57e150daf2164 77 | AmplifyPlugins: 3ed478220b60e5544f3a4968beb971b4d8abcb34 78 | AWSAuthCore: 2aaf8dec7f50e3f7606857bdca0db9263faed0c5 79 | AWSCognitoIdentityProvider: fcd9b00fec0ef5ac6768548af948ad033b52da98 80 | AWSCognitoIdentityProviderASF: 719578cca39b3233bd67e656bdf04d409e8fc255 81 | AWSCore: c60e635b1a61cb27b6dfff646ce9f402be870b62 82 | AWSMobileClient: bdfc148fc11b846331f2bec4a7063c95e66c329e 83 | AWSPluginsCore: 6305f711ed8d967ba3b46e272cdad8f857e2ed4a 84 | Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c 85 | ObjectMapper: 1eb41f610210777375fa806bf161dc39fb832b81 86 | 87 | PODFILE CHECKSUM: cc1f88378b4bfcf93a6ce00d2c587857c6008d3b 88 | 89 | COCOAPODS: 1.10.1 90 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 51; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 539CACBCBA972912661FFFA0 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 113216138176136E3604E768 /* Pods_Runner.framework */; }; 13 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 14 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 15 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 16 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXCopyFilesBuildPhase section */ 20 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 21 | isa = PBXCopyFilesBuildPhase; 22 | buildActionMask = 2147483647; 23 | dstPath = ""; 24 | dstSubfolderSpec = 10; 25 | files = ( 26 | ); 27 | name = "Embed Frameworks"; 28 | runOnlyForDeploymentPostprocessing = 0; 29 | }; 30 | /* End PBXCopyFilesBuildPhase section */ 31 | 32 | /* Begin PBXFileReference section */ 33 | 113216138176136E3604E768 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 35 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 36 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 37 | 5F595A9A3F7E6EB2BF8C375A /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 38 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 39 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 40 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 41 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 42 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 43 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 45 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 46 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 47 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | B54107B94D177BE281C2D500 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 49 | D59AFC038403362BD1BC4F41 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 50 | /* End PBXFileReference section */ 51 | 52 | /* Begin PBXFrameworksBuildPhase section */ 53 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 54 | isa = PBXFrameworksBuildPhase; 55 | buildActionMask = 2147483647; 56 | files = ( 57 | 539CACBCBA972912661FFFA0 /* Pods_Runner.framework in Frameworks */, 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXFrameworksBuildPhase section */ 62 | 63 | /* Begin PBXGroup section */ 64 | 8718A720B593D29DBF8FD3C5 /* Pods */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | B54107B94D177BE281C2D500 /* Pods-Runner.debug.xcconfig */, 68 | D59AFC038403362BD1BC4F41 /* Pods-Runner.release.xcconfig */, 69 | 5F595A9A3F7E6EB2BF8C375A /* Pods-Runner.profile.xcconfig */, 70 | ); 71 | path = Pods; 72 | sourceTree = ""; 73 | }; 74 | 9740EEB11CF90186004384FC /* Flutter */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 78 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 79 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 80 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 81 | ); 82 | name = Flutter; 83 | sourceTree = ""; 84 | }; 85 | 97C146E51CF9000F007C117D = { 86 | isa = PBXGroup; 87 | children = ( 88 | 9740EEB11CF90186004384FC /* Flutter */, 89 | 97C146F01CF9000F007C117D /* Runner */, 90 | 97C146EF1CF9000F007C117D /* Products */, 91 | 8718A720B593D29DBF8FD3C5 /* Pods */, 92 | E855F414C633ABD2D54F4197 /* Frameworks */, 93 | ); 94 | sourceTree = ""; 95 | }; 96 | 97C146EF1CF9000F007C117D /* Products */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 97C146EE1CF9000F007C117D /* Runner.app */, 100 | ); 101 | name = Products; 102 | sourceTree = ""; 103 | }; 104 | 97C146F01CF9000F007C117D /* Runner */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 108 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 109 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 110 | 97C147021CF9000F007C117D /* Info.plist */, 111 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 112 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 113 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 114 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 115 | ); 116 | path = Runner; 117 | sourceTree = ""; 118 | }; 119 | E855F414C633ABD2D54F4197 /* Frameworks */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 113216138176136E3604E768 /* Pods_Runner.framework */, 123 | ); 124 | name = Frameworks; 125 | sourceTree = ""; 126 | }; 127 | /* End PBXGroup section */ 128 | 129 | /* Begin PBXNativeTarget section */ 130 | 97C146ED1CF9000F007C117D /* Runner */ = { 131 | isa = PBXNativeTarget; 132 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 133 | buildPhases = ( 134 | 31393AF5F2226345A07468BC /* [CP] Check Pods Manifest.lock */, 135 | 9740EEB61CF901F6004384FC /* Run Script */, 136 | 97C146EA1CF9000F007C117D /* Sources */, 137 | 97C146EB1CF9000F007C117D /* Frameworks */, 138 | 97C146EC1CF9000F007C117D /* Resources */, 139 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 140 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 141 | 1BD6E077C6C185F1C0644B80 /* [CP] Embed Pods Frameworks */, 142 | ); 143 | buildRules = ( 144 | ); 145 | dependencies = ( 146 | ); 147 | name = Runner; 148 | productName = Runner; 149 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 150 | productType = "com.apple.product-type.application"; 151 | }; 152 | /* End PBXNativeTarget section */ 153 | 154 | /* Begin PBXProject section */ 155 | 97C146E61CF9000F007C117D /* Project object */ = { 156 | isa = PBXProject; 157 | attributes = { 158 | LastUpgradeCheck = 1020; 159 | ORGANIZATIONNAME = ""; 160 | TargetAttributes = { 161 | 97C146ED1CF9000F007C117D = { 162 | CreatedOnToolsVersion = 7.3.1; 163 | LastSwiftMigration = 1100; 164 | }; 165 | }; 166 | }; 167 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 168 | compatibilityVersion = "Xcode 9.3"; 169 | developmentRegion = en; 170 | hasScannedForEncodings = 0; 171 | knownRegions = ( 172 | en, 173 | Base, 174 | ); 175 | mainGroup = 97C146E51CF9000F007C117D; 176 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 177 | projectDirPath = ""; 178 | projectRoot = ""; 179 | targets = ( 180 | 97C146ED1CF9000F007C117D /* Runner */, 181 | ); 182 | }; 183 | /* End PBXProject section */ 184 | 185 | /* Begin PBXResourcesBuildPhase section */ 186 | 97C146EC1CF9000F007C117D /* Resources */ = { 187 | isa = PBXResourcesBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 191 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 192 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 193 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 194 | ); 195 | runOnlyForDeploymentPostprocessing = 0; 196 | }; 197 | /* End PBXResourcesBuildPhase section */ 198 | 199 | /* Begin PBXShellScriptBuildPhase section */ 200 | 1BD6E077C6C185F1C0644B80 /* [CP] Embed Pods Frameworks */ = { 201 | isa = PBXShellScriptBuildPhase; 202 | buildActionMask = 2147483647; 203 | files = ( 204 | ); 205 | inputFileListPaths = ( 206 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", 207 | ); 208 | name = "[CP] Embed Pods Frameworks"; 209 | outputFileListPaths = ( 210 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", 211 | ); 212 | runOnlyForDeploymentPostprocessing = 0; 213 | shellPath = /bin/sh; 214 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 215 | showEnvVarsInLog = 0; 216 | }; 217 | 31393AF5F2226345A07468BC /* [CP] Check Pods Manifest.lock */ = { 218 | isa = PBXShellScriptBuildPhase; 219 | buildActionMask = 2147483647; 220 | files = ( 221 | ); 222 | inputFileListPaths = ( 223 | ); 224 | inputPaths = ( 225 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 226 | "${PODS_ROOT}/Manifest.lock", 227 | ); 228 | name = "[CP] Check Pods Manifest.lock"; 229 | outputFileListPaths = ( 230 | ); 231 | outputPaths = ( 232 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 233 | ); 234 | runOnlyForDeploymentPostprocessing = 0; 235 | shellPath = /bin/sh; 236 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 237 | showEnvVarsInLog = 0; 238 | }; 239 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 240 | isa = PBXShellScriptBuildPhase; 241 | buildActionMask = 2147483647; 242 | files = ( 243 | ); 244 | inputPaths = ( 245 | ); 246 | name = "Thin Binary"; 247 | outputPaths = ( 248 | ); 249 | runOnlyForDeploymentPostprocessing = 0; 250 | shellPath = /bin/sh; 251 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 252 | }; 253 | 9740EEB61CF901F6004384FC /* Run Script */ = { 254 | isa = PBXShellScriptBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | ); 258 | inputPaths = ( 259 | ); 260 | name = "Run Script"; 261 | outputPaths = ( 262 | ); 263 | runOnlyForDeploymentPostprocessing = 0; 264 | shellPath = /bin/sh; 265 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 266 | }; 267 | /* End PBXShellScriptBuildPhase section */ 268 | 269 | /* Begin PBXSourcesBuildPhase section */ 270 | 97C146EA1CF9000F007C117D /* Sources */ = { 271 | isa = PBXSourcesBuildPhase; 272 | buildActionMask = 2147483647; 273 | files = ( 274 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 275 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 276 | ); 277 | runOnlyForDeploymentPostprocessing = 0; 278 | }; 279 | /* End PBXSourcesBuildPhase section */ 280 | 281 | /* Begin PBXVariantGroup section */ 282 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 283 | isa = PBXVariantGroup; 284 | children = ( 285 | 97C146FB1CF9000F007C117D /* Base */, 286 | ); 287 | name = Main.storyboard; 288 | sourceTree = ""; 289 | }; 290 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 291 | isa = PBXVariantGroup; 292 | children = ( 293 | 97C147001CF9000F007C117D /* Base */, 294 | ); 295 | name = LaunchScreen.storyboard; 296 | sourceTree = ""; 297 | }; 298 | /* End PBXVariantGroup section */ 299 | 300 | /* Begin XCBuildConfiguration section */ 301 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 302 | isa = XCBuildConfiguration; 303 | buildSettings = { 304 | ALWAYS_SEARCH_USER_PATHS = NO; 305 | CLANG_ANALYZER_NONNULL = YES; 306 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 307 | CLANG_CXX_LIBRARY = "libc++"; 308 | CLANG_ENABLE_MODULES = YES; 309 | CLANG_ENABLE_OBJC_ARC = YES; 310 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 311 | CLANG_WARN_BOOL_CONVERSION = YES; 312 | CLANG_WARN_COMMA = YES; 313 | CLANG_WARN_CONSTANT_CONVERSION = YES; 314 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 315 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 316 | CLANG_WARN_EMPTY_BODY = YES; 317 | CLANG_WARN_ENUM_CONVERSION = YES; 318 | CLANG_WARN_INFINITE_RECURSION = YES; 319 | CLANG_WARN_INT_CONVERSION = YES; 320 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 321 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 322 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 323 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 324 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 325 | CLANG_WARN_STRICT_PROTOTYPES = YES; 326 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 327 | CLANG_WARN_UNREACHABLE_CODE = YES; 328 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 329 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 330 | COPY_PHASE_STRIP = NO; 331 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 332 | ENABLE_NS_ASSERTIONS = NO; 333 | ENABLE_STRICT_OBJC_MSGSEND = YES; 334 | GCC_C_LANGUAGE_STANDARD = gnu99; 335 | GCC_NO_COMMON_BLOCKS = YES; 336 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 337 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 338 | GCC_WARN_UNDECLARED_SELECTOR = YES; 339 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 340 | GCC_WARN_UNUSED_FUNCTION = YES; 341 | GCC_WARN_UNUSED_VARIABLE = YES; 342 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 343 | MTL_ENABLE_DEBUG_INFO = NO; 344 | SDKROOT = iphoneos; 345 | SUPPORTED_PLATFORMS = iphoneos; 346 | TARGETED_DEVICE_FAMILY = "1,2"; 347 | VALIDATE_PRODUCT = YES; 348 | }; 349 | name = Profile; 350 | }; 351 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 352 | isa = XCBuildConfiguration; 353 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 354 | buildSettings = { 355 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 356 | CLANG_ENABLE_MODULES = YES; 357 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 358 | ENABLE_BITCODE = NO; 359 | INFOPLIST_FILE = Runner/Info.plist; 360 | LD_RUNPATH_SEARCH_PATHS = ( 361 | "$(inherited)", 362 | "@executable_path/Frameworks", 363 | ); 364 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterAmplifyAuthDemo; 365 | PRODUCT_NAME = "$(TARGET_NAME)"; 366 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 367 | SWIFT_VERSION = 5.0; 368 | VERSIONING_SYSTEM = "apple-generic"; 369 | }; 370 | name = Profile; 371 | }; 372 | 97C147031CF9000F007C117D /* Debug */ = { 373 | isa = XCBuildConfiguration; 374 | buildSettings = { 375 | ALWAYS_SEARCH_USER_PATHS = NO; 376 | CLANG_ANALYZER_NONNULL = YES; 377 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 378 | CLANG_CXX_LIBRARY = "libc++"; 379 | CLANG_ENABLE_MODULES = YES; 380 | CLANG_ENABLE_OBJC_ARC = YES; 381 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 382 | CLANG_WARN_BOOL_CONVERSION = YES; 383 | CLANG_WARN_COMMA = YES; 384 | CLANG_WARN_CONSTANT_CONVERSION = YES; 385 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 386 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 387 | CLANG_WARN_EMPTY_BODY = YES; 388 | CLANG_WARN_ENUM_CONVERSION = YES; 389 | CLANG_WARN_INFINITE_RECURSION = YES; 390 | CLANG_WARN_INT_CONVERSION = YES; 391 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 392 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 393 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 394 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 395 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 396 | CLANG_WARN_STRICT_PROTOTYPES = YES; 397 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 398 | CLANG_WARN_UNREACHABLE_CODE = YES; 399 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 400 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 401 | COPY_PHASE_STRIP = NO; 402 | DEBUG_INFORMATION_FORMAT = dwarf; 403 | ENABLE_STRICT_OBJC_MSGSEND = YES; 404 | ENABLE_TESTABILITY = YES; 405 | GCC_C_LANGUAGE_STANDARD = gnu99; 406 | GCC_DYNAMIC_NO_PIC = NO; 407 | GCC_NO_COMMON_BLOCKS = YES; 408 | GCC_OPTIMIZATION_LEVEL = 0; 409 | GCC_PREPROCESSOR_DEFINITIONS = ( 410 | "DEBUG=1", 411 | "$(inherited)", 412 | ); 413 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 414 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 415 | GCC_WARN_UNDECLARED_SELECTOR = YES; 416 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 417 | GCC_WARN_UNUSED_FUNCTION = YES; 418 | GCC_WARN_UNUSED_VARIABLE = YES; 419 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 420 | MTL_ENABLE_DEBUG_INFO = YES; 421 | ONLY_ACTIVE_ARCH = YES; 422 | SDKROOT = iphoneos; 423 | TARGETED_DEVICE_FAMILY = "1,2"; 424 | }; 425 | name = Debug; 426 | }; 427 | 97C147041CF9000F007C117D /* Release */ = { 428 | isa = XCBuildConfiguration; 429 | buildSettings = { 430 | ALWAYS_SEARCH_USER_PATHS = NO; 431 | CLANG_ANALYZER_NONNULL = YES; 432 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 433 | CLANG_CXX_LIBRARY = "libc++"; 434 | CLANG_ENABLE_MODULES = YES; 435 | CLANG_ENABLE_OBJC_ARC = YES; 436 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 437 | CLANG_WARN_BOOL_CONVERSION = YES; 438 | CLANG_WARN_COMMA = YES; 439 | CLANG_WARN_CONSTANT_CONVERSION = YES; 440 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 441 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 442 | CLANG_WARN_EMPTY_BODY = YES; 443 | CLANG_WARN_ENUM_CONVERSION = YES; 444 | CLANG_WARN_INFINITE_RECURSION = YES; 445 | CLANG_WARN_INT_CONVERSION = YES; 446 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 447 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 448 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 449 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 450 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 451 | CLANG_WARN_STRICT_PROTOTYPES = YES; 452 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 453 | CLANG_WARN_UNREACHABLE_CODE = YES; 454 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 455 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 456 | COPY_PHASE_STRIP = NO; 457 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 458 | ENABLE_NS_ASSERTIONS = NO; 459 | ENABLE_STRICT_OBJC_MSGSEND = YES; 460 | GCC_C_LANGUAGE_STANDARD = gnu99; 461 | GCC_NO_COMMON_BLOCKS = YES; 462 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 463 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 464 | GCC_WARN_UNDECLARED_SELECTOR = YES; 465 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 466 | GCC_WARN_UNUSED_FUNCTION = YES; 467 | GCC_WARN_UNUSED_VARIABLE = YES; 468 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 469 | MTL_ENABLE_DEBUG_INFO = NO; 470 | SDKROOT = iphoneos; 471 | SUPPORTED_PLATFORMS = iphoneos; 472 | SWIFT_COMPILATION_MODE = wholemodule; 473 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 474 | TARGETED_DEVICE_FAMILY = "1,2"; 475 | VALIDATE_PRODUCT = YES; 476 | }; 477 | name = Release; 478 | }; 479 | 97C147061CF9000F007C117D /* Debug */ = { 480 | isa = XCBuildConfiguration; 481 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 482 | buildSettings = { 483 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 484 | CLANG_ENABLE_MODULES = YES; 485 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 486 | ENABLE_BITCODE = NO; 487 | INFOPLIST_FILE = Runner/Info.plist; 488 | LD_RUNPATH_SEARCH_PATHS = ( 489 | "$(inherited)", 490 | "@executable_path/Frameworks", 491 | ); 492 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterAmplifyAuthDemo; 493 | PRODUCT_NAME = "$(TARGET_NAME)"; 494 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 495 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 496 | SWIFT_VERSION = 5.0; 497 | VERSIONING_SYSTEM = "apple-generic"; 498 | }; 499 | name = Debug; 500 | }; 501 | 97C147071CF9000F007C117D /* Release */ = { 502 | isa = XCBuildConfiguration; 503 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 504 | buildSettings = { 505 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 506 | CLANG_ENABLE_MODULES = YES; 507 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 508 | ENABLE_BITCODE = NO; 509 | INFOPLIST_FILE = Runner/Info.plist; 510 | LD_RUNPATH_SEARCH_PATHS = ( 511 | "$(inherited)", 512 | "@executable_path/Frameworks", 513 | ); 514 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterAmplifyAuthDemo; 515 | PRODUCT_NAME = "$(TARGET_NAME)"; 516 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 517 | SWIFT_VERSION = 5.0; 518 | VERSIONING_SYSTEM = "apple-generic"; 519 | }; 520 | name = Release; 521 | }; 522 | /* End XCBuildConfiguration section */ 523 | 524 | /* Begin XCConfigurationList section */ 525 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 526 | isa = XCConfigurationList; 527 | buildConfigurations = ( 528 | 97C147031CF9000F007C117D /* Debug */, 529 | 97C147041CF9000F007C117D /* Release */, 530 | 249021D3217E4FDB00AE95B9 /* Profile */, 531 | ); 532 | defaultConfigurationIsVisible = 0; 533 | defaultConfigurationName = Release; 534 | }; 535 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 536 | isa = XCConfigurationList; 537 | buildConfigurations = ( 538 | 97C147061CF9000F007C117D /* Debug */, 539 | 97C147071CF9000F007C117D /* Release */, 540 | 249021D4217E4FDB00AE95B9 /* Profile */, 541 | ); 542 | defaultConfigurationIsVisible = 0; 543 | defaultConfigurationName = Release; 544 | }; 545 | /* End XCConfigurationList section */ 546 | }; 547 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 548 | } 549 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Amplify Auth Demo 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | flutter_amplify_auth_demo 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleURLTypes 24 | 25 | 26 | CFBundleURLSchemes 27 | 28 | myapp 29 | 30 | 31 | 32 | CFBundleVersion 33 | $(FLUTTER_BUILD_NUMBER) 34 | LSRequiresIPhoneOS 35 | 36 | UILaunchStoryboardName 37 | LaunchScreen 38 | UIMainStoryboardFile 39 | Main 40 | UISupportedInterfaceOrientations 41 | 42 | UIInterfaceOrientationPortrait 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | UISupportedInterfaceOrientations~ipad 47 | 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationPortraitUpsideDown 50 | UIInterfaceOrientationLandscapeLeft 51 | UIInterfaceOrientationLandscapeRight 52 | 53 | UIViewControllerBasedStatusBarAppearance 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /lib/amplifyconfiguration.dart: -------------------------------------------------------------------------------- 1 | const amplifyconfig = ''' { 2 | "UserAgent": "aws-amplify-cli/2.0", 3 | "Version": "1.0", 4 | "auth": { 5 | "plugins": { 6 | "awsCognitoAuthPlugin": { 7 | "UserAgent": "aws-amplify-cli/0.1.0", 8 | "Version": "0.1.0", 9 | "IdentityManager": { 10 | "Default": {} 11 | }, 12 | "CredentialsProvider": { 13 | "CognitoIdentity": { 14 | "Default": { 15 | "PoolId": "us-east-1:a6e1a1a6-9591-45df-b526-f652251650f6", 16 | "Region": "us-east-1" 17 | } 18 | } 19 | }, 20 | "CognitoUserPool": { 21 | "Default": { 22 | "PoolId": "us-east-1_E0AL44XNm", 23 | "AppClientId": "6tp01i28n3be8ae9h9kcijta6o", 24 | "Region": "us-east-1" 25 | } 26 | }, 27 | "Auth": { 28 | "Default": { 29 | "OAuth": { 30 | "WebDomain": "h504ojo61g90-staging.auth.us-east-1.amazoncognito.com", 31 | "AppClientId": "6tp01i28n3be8ae9h9kcijta6o", 32 | "SignInRedirectURI": "myapp://", 33 | "SignOutRedirectURI": "myapp://", 34 | "Scopes": [ 35 | "phone", 36 | "email", 37 | "openid", 38 | "profile", 39 | "aws.cognito.signin.user.admin" 40 | ] 41 | }, 42 | "authenticationFlowType": "USER_SRP_AUTH" 43 | } 44 | } 45 | } 46 | } 47 | } 48 | }'''; -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_amplify_auth_demo/models/email_sign_in.dart'; 3 | import 'package:flutter_amplify_auth_demo/pages/landing_page.dart'; 4 | import 'package:provider/provider.dart'; 5 | 6 | import 'models/app_user.dart'; 7 | 8 | void main() { 9 | runApp(MyApp()); 10 | } 11 | 12 | class MyApp extends StatelessWidget { 13 | @override 14 | Widget build(BuildContext context) { 15 | return MultiProvider( 16 | providers: [ 17 | ChangeNotifierProvider( 18 | create: (ctx) => AppUser(), 19 | ), 20 | ], 21 | child: MaterialApp( 22 | title: 'Amplify Auth Demo', 23 | theme: ThemeData( 24 | primarySwatch: Colors.deepPurple, 25 | ), 26 | home: LandingPage(), 27 | ), 28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/models/app_user.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:amplify_flutter/amplify.dart'; 3 | import 'package:amplify_auth_cognito/amplify_auth_cognito.dart'; 4 | import '../amplifyconfiguration.dart'; 5 | 6 | class AppUser extends ChangeNotifier { 7 | bool isSignedIn = false; 8 | String username; 9 | 10 | AppUser() { 11 | if (!Amplify.isConfigured) configureAmplify(); 12 | } 13 | 14 | void configureAmplify() async { 15 | AmplifyAuthCognito authPlugin = AmplifyAuthCognito(); 16 | Amplify.addPlugins([authPlugin]); 17 | 18 | try { 19 | await Amplify.configure(amplifyconfig); 20 | } catch (e) { 21 | print('Error ' + e.toString()); 22 | } finally { 23 | // For development let's make sure we are signed out 24 | signOut(); 25 | } 26 | } 27 | 28 | void signIn(AuthProvider authProvider) async { 29 | try { 30 | await Amplify.Auth.signInWithWebUI(provider: authProvider); 31 | isSignedIn = true; 32 | notifyListeners(); 33 | } catch (e) { 34 | throw e; 35 | } 36 | } 37 | 38 | void signOut() async { 39 | try { 40 | await Amplify.Auth.signOut(); 41 | isSignedIn = false; 42 | notifyListeners(); 43 | } on AuthException catch (e) { 44 | print(e.message); 45 | } 46 | } 47 | 48 | Future registerWithEmailAndPassword( 49 | String email, String password) async { 50 | try { 51 | Map userAttributes = { 52 | 'email': email, 53 | 'preferred_username': email, 54 | // additional attributes as needed 55 | }; 56 | await Amplify.Auth.signUp( 57 | username: email, 58 | password: password, 59 | options: CognitoSignUpOptions(userAttributes: userAttributes)); 60 | return true; 61 | } on AuthException catch (e) { 62 | print(e.message); 63 | throw e; 64 | } 65 | } 66 | 67 | signInWithEmailAndPassword(String email, String password) async { 68 | try { 69 | SignInResult res = await Amplify.Auth.signIn( 70 | username: email.trim(), 71 | password: password.trim(), 72 | ); 73 | 74 | isSignedIn = res.isSignedIn; 75 | notifyListeners(); 76 | } catch (e) { 77 | throw e; 78 | } 79 | } 80 | 81 | confirmRegisterWithCode(String email, String code) async { 82 | try { 83 | SignUpResult res = await Amplify.Auth.confirmSignUp( 84 | username: email, confirmationCode: code); 85 | 86 | isSignedIn = res.isSignUpComplete; 87 | notifyListeners(); 88 | return true; 89 | } on AuthException catch (e) { 90 | throw e; 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /lib/models/buttons_enum.dart: -------------------------------------------------------------------------------- 1 | enum Buttons { 2 | /// This is a list of all the library built buttons. 3 | Email, 4 | Google, 5 | Facebook, 6 | Amazon, 7 | Apple, 8 | } 9 | -------------------------------------------------------------------------------- /lib/models/email_sign_in.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_amplify_auth_demo/models/app_user.dart'; 3 | import 'package:flutter_amplify_auth_demo/models/validators.dart'; 4 | 5 | enum EmailSignInFormType { signIn, register, confirm } 6 | 7 | class EmailSignIn with EmailAndPasswordValidator, ChangeNotifier { 8 | final AppUser appUser; 9 | String email; 10 | String password; 11 | EmailSignInFormType formType; 12 | bool isLoading; 13 | bool submitted; 14 | String code; 15 | 16 | EmailSignIn({ 17 | @required this.appUser, 18 | this.email = '', 19 | this.password = '', 20 | this.formType = EmailSignInFormType.signIn, 21 | this.isLoading = false, 22 | this.submitted = false, 23 | this.code = '', 24 | }); 25 | 26 | String get primaryButtonText { 27 | switch (formType) { 28 | case EmailSignInFormType.signIn: 29 | return 'Sign In'; 30 | case EmailSignInFormType.register: 31 | return 'Create an account'; 32 | case EmailSignInFormType.confirm: 33 | return 'Confirm Sign Up'; 34 | } 35 | } 36 | 37 | String get secondaryButtonText { 38 | return formType == EmailSignInFormType.signIn 39 | ? 'Need an account? Register' 40 | : 'Have an account? Sign in'; 41 | } 42 | 43 | String get passwordErrorText { 44 | bool showErrorText = submitted && !passwordValidator.isValid(password); 45 | return showErrorText ? invalidPasswordErrorText : null; 46 | } 47 | 48 | String get emailErrorText { 49 | bool showErrorText = submitted && !emailValidator.isValid(email); 50 | return showErrorText ? invalidEmailErrorText : null; 51 | } 52 | 53 | bool get submitEnabled { 54 | return emailValidator.isValid(email) && 55 | passwordValidator.isValid(password) && 56 | !isLoading; 57 | } 58 | 59 | void updateEmail(String email) => updateWith(email: email); 60 | 61 | void updateCode(String code) => updateWith(code: code); 62 | 63 | void updatePassword(String password) => updateWith(password: password); 64 | 65 | void toggleFormType() { 66 | updateWith( 67 | submitted: false, 68 | email: '', 69 | password: '', 70 | code: '', 71 | isLoading: false, 72 | formType: this.formType == EmailSignInFormType.signIn 73 | ? EmailSignInFormType.register 74 | : EmailSignInFormType.signIn); 75 | } 76 | 77 | Future submit() async { 78 | updateWith(submitted: true, isLoading: true); 79 | 80 | try { 81 | switch (formType) { 82 | case EmailSignInFormType.signIn: 83 | final user = 84 | await appUser.signInWithEmailAndPassword(email, password); 85 | break; 86 | case EmailSignInFormType.register: 87 | final isSignedUp = 88 | await appUser.registerWithEmailAndPassword(email, password); 89 | if (isSignedUp) { 90 | updateWith( 91 | formType: EmailSignInFormType.confirm, 92 | isLoading: false, 93 | submitted: false); 94 | } 95 | break; 96 | case EmailSignInFormType.confirm: 97 | final user = await appUser.confirmRegisterWithCode(email, code); 98 | } 99 | } catch (e) { 100 | updateWith(isLoading: false); 101 | rethrow; 102 | } 103 | } 104 | 105 | void updateWith({ 106 | String email, 107 | String password, 108 | EmailSignInFormType formType, 109 | bool isLoading, 110 | bool submitted, 111 | String code, 112 | }) { 113 | this.email = email ?? this.email; 114 | this.password = password ?? this.password; 115 | this.formType = formType ?? this.formType; 116 | this.isLoading = isLoading ?? this.isLoading; 117 | this.submitted = submitted ?? this.submitted; 118 | this.code = code ?? this.code; 119 | notifyListeners(); 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /lib/models/validators.dart: -------------------------------------------------------------------------------- 1 | abstract class StringValidator { 2 | bool isValid(String value); 3 | } 4 | 5 | class NonEmptyStringValidator implements StringValidator { 6 | @override 7 | bool isValid(String value) { 8 | return value.isNotEmpty; 9 | } 10 | } 11 | 12 | class EmailAndPasswordValidator { 13 | final StringValidator emailValidator = NonEmptyStringValidator(); 14 | final StringValidator passwordValidator = NonEmptyStringValidator(); 15 | final String invalidEmailErrorText = 'Email can\'t be empty'; 16 | final String invalidPasswordErrorText = 'Password can\'t be empty'; 17 | } 18 | -------------------------------------------------------------------------------- /lib/pages/email_sign_in_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_amplify_auth_demo/widgets/email_sign_in_form.dart'; 3 | 4 | class EmailSignInPage extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return Scaffold( 8 | appBar: AppBar( 9 | title: Text('Sign In'), 10 | elevation: 10, 11 | ), 12 | body: SingleChildScrollView( 13 | child: Padding( 14 | padding: const EdgeInsets.all(16.0), 15 | child: Card( 16 | child: EmailSignInForm.create(context), 17 | ), 18 | ), 19 | ), 20 | backgroundColor: Colors.grey[200], 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/pages/home_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_amplify_auth_demo/models/app_user.dart'; 3 | import 'package:provider/provider.dart'; 4 | 5 | class HomePage extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | return Scaffold( 9 | appBar: AppBar( 10 | title: Text('Amplify Auth Demo'), 11 | actions: [ 12 | TextButton( 13 | onPressed: () => context.read().signOut(), 14 | child: Text( 15 | 'Logout', 16 | style: TextStyle(color: Colors.white, fontSize: 14), 17 | ), 18 | ), 19 | ], 20 | ), 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/pages/landing_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_amplify_auth_demo/models/app_user.dart'; 3 | import 'package:flutter_amplify_auth_demo/pages/home_page.dart'; 4 | import 'package:flutter_amplify_auth_demo/pages/sign_in_page.dart'; 5 | import 'package:provider/provider.dart'; 6 | 7 | class LandingPage extends StatelessWidget { 8 | @override 9 | Widget build(BuildContext context) { 10 | final appUser = context.watch().isSignedIn; 11 | print(appUser); 12 | return appUser ? HomePage() : SignInPage(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/pages/sign_in_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:amplify_auth_cognito/amplify_auth_cognito.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_amplify_auth_demo/models/app_user.dart'; 4 | import 'package:flutter_amplify_auth_demo/pages/email_sign_in_page.dart'; 5 | import 'package:flutter_amplify_auth_demo/widgets/sign_in_button.dart'; 6 | import 'package:provider/provider.dart'; 7 | import 'package:flutter_amplify_auth_demo/models/buttons_enum.dart'; 8 | 9 | class SignInPage extends StatelessWidget { 10 | void _signInWithEmail(BuildContext context) { 11 | Navigator.of(context).push( 12 | MaterialPageRoute( 13 | builder: (context) => EmailSignInPage(), fullscreenDialog: true), 14 | ); 15 | } 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | return Scaffold( 20 | appBar: AppBar( 21 | title: Text('Amplify Auth Demo'), 22 | elevation: 10, 23 | ), 24 | body: _buildContent(context), 25 | backgroundColor: Colors.grey[200], 26 | ); 27 | } 28 | 29 | Widget _buildContent(BuildContext context) { 30 | return Padding( 31 | padding: EdgeInsets.all(16), 32 | child: Column( 33 | mainAxisAlignment: MainAxisAlignment.center, 34 | crossAxisAlignment: CrossAxisAlignment.stretch, 35 | children: [ 36 | SizedBox( 37 | child: Text( 38 | 'Sign In', 39 | textAlign: TextAlign.center, 40 | style: TextStyle( 41 | fontSize: 32, 42 | fontWeight: FontWeight.w600, 43 | ), 44 | ), 45 | height: 50.0, 46 | ), 47 | SizedBox( 48 | height: 48.0, 49 | ), 50 | SocialSignInButton( 51 | button: Buttons.Google, 52 | onPressed: () => 53 | context.read().signIn(AuthProvider.google), 54 | color: Colors.white, 55 | text: 'Sign in with Google', 56 | textColor: Colors.black87, 57 | ), 58 | SizedBox( 59 | height: 8.0, 60 | ), 61 | SocialSignInButton( 62 | button: Buttons.Facebook, 63 | onPressed: () => 64 | context.read().signIn(AuthProvider.facebook), 65 | color: Color(0xFF334D92), 66 | text: 'Sign in with Facebook', 67 | textColor: Colors.white, 68 | ), 69 | SizedBox( 70 | height: 8.0, 71 | ), 72 | SocialSignInButton( 73 | button: Buttons.Amazon, 74 | onPressed: () => 75 | context.read().signIn(AuthProvider.amazon), 76 | color: Colors.black54, 77 | text: 'Sign in with Amazon', 78 | textColor: Colors.white, 79 | ), 80 | SizedBox( 81 | height: 8.0, 82 | ), 83 | Text( 84 | 'Or', 85 | style: TextStyle( 86 | fontSize: 14, 87 | color: Colors.black87, 88 | ), 89 | textAlign: TextAlign.center, 90 | ), 91 | SizedBox( 92 | height: 8.0, 93 | ), 94 | SocialSignInButton( 95 | button: Buttons.Email, 96 | onPressed: () => _signInWithEmail(context), 97 | color: Colors.deepOrange, 98 | text: 'Sign in with email', 99 | textColor: Colors.white, 100 | ), 101 | ], 102 | ), 103 | ); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /lib/widgets/email_sign_in_form.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_amplify_auth_demo/models/app_user.dart'; 3 | import 'package:flutter_amplify_auth_demo/models/email_sign_in.dart'; 4 | import 'package:flutter_amplify_auth_demo/widgets/show_error_dialog.dart'; 5 | import 'package:provider/provider.dart'; 6 | 7 | class EmailSignInForm extends StatefulWidget { 8 | final EmailSignIn model; 9 | 10 | const EmailSignInForm({Key key, this.model}) : super(key: key); 11 | 12 | static Widget create(BuildContext context) { 13 | final appUser = Provider.of(context, listen: false); 14 | return ChangeNotifierProvider( 15 | create: (_) => EmailSignIn(appUser: appUser), 16 | child: Consumer( 17 | builder: (_, model, __) => EmailSignInForm(model: model), 18 | ), 19 | ); 20 | } 21 | 22 | @override 23 | _EmailSignInFormState createState() => _EmailSignInFormState(); 24 | } 25 | 26 | class _EmailSignInFormState extends State { 27 | final TextEditingController _emailController = TextEditingController(); 28 | final TextEditingController _passwordController = TextEditingController(); 29 | final TextEditingController _codeController = TextEditingController(); 30 | final FocusNode _codeFocusNode = FocusNode(); 31 | final FocusNode _emailFocusNode = FocusNode(); 32 | final FocusNode _passwordFocusNode = FocusNode(); 33 | 34 | EmailSignIn get model => widget.model; 35 | 36 | void _emailEditingComplete() { 37 | if (model.emailValidator.isValid(model.email)) 38 | FocusScope.of(context).requestFocus(_passwordFocusNode); 39 | else 40 | FocusScope.of(context).requestFocus(_emailFocusNode); 41 | } 42 | 43 | @override 44 | void dispose() { 45 | _emailController.dispose(); 46 | _passwordController.dispose(); 47 | _codeController.dispose(); 48 | _codeFocusNode.dispose(); 49 | _emailFocusNode.dispose(); 50 | _passwordFocusNode.dispose(); 51 | super.dispose(); 52 | } 53 | 54 | Future _submit() async { 55 | try { 56 | await model.submit(); 57 | if (model.submitted) { 58 | Navigator.of(context).pop(); 59 | } 60 | } catch (e) { 61 | showErrorDialog( 62 | context, 63 | title: 'Error', 64 | content: e.message, 65 | defaultActionText: 'Ok', 66 | ); 67 | } 68 | } 69 | 70 | void _toggleFormType() { 71 | model.toggleFormType(); 72 | _emailController.clear(); 73 | _passwordController.clear(); 74 | _codeController.clear(); 75 | } 76 | 77 | @override 78 | Widget build(BuildContext context) { 79 | return Padding( 80 | padding: const EdgeInsets.all(16.0), 81 | child: Column( 82 | crossAxisAlignment: CrossAxisAlignment.stretch, 83 | mainAxisSize: MainAxisSize.min, 84 | children: model.formType == EmailSignInFormType.confirm 85 | ? _buildConfirmchildren() 86 | : _buildFormchildren(), 87 | ), 88 | ); 89 | } 90 | 91 | List _buildFormchildren() { 92 | return [ 93 | TextField( 94 | decoration: InputDecoration( 95 | enabled: model.isLoading == false, 96 | labelText: 'Email', 97 | hintText: 'test@test.com', 98 | errorText: model.emailErrorText, 99 | ), 100 | controller: _emailController, 101 | autocorrect: false, 102 | keyboardType: TextInputType.emailAddress, 103 | textInputAction: TextInputAction.next, 104 | focusNode: _emailFocusNode, 105 | onEditingComplete: () => _emailEditingComplete(), 106 | onChanged: model.updateEmail, 107 | ), 108 | SizedBox( 109 | height: 8.0, 110 | ), 111 | TextField( 112 | decoration: InputDecoration( 113 | enabled: model.isLoading == false, 114 | labelText: 'Password', 115 | errorText: model.passwordErrorText, 116 | ), 117 | obscureText: true, 118 | controller: _passwordController, 119 | textInputAction: TextInputAction.done, 120 | focusNode: _passwordFocusNode, 121 | onEditingComplete: _submit, 122 | onChanged: model.updatePassword, 123 | ), 124 | SizedBox( 125 | height: 8.0, 126 | ), 127 | ElevatedButton( 128 | onPressed: model.submitEnabled ? _submit : null, 129 | child: Text( 130 | model.primaryButtonText, 131 | ), 132 | ), 133 | SizedBox( 134 | height: 8.0, 135 | ), 136 | TextButton( 137 | onPressed: !model.isLoading ? _toggleFormType : null, 138 | child: Text(model.secondaryButtonText), 139 | ) 140 | ]; 141 | } 142 | 143 | List _buildConfirmchildren() { 144 | return [ 145 | TextField( 146 | decoration: InputDecoration( 147 | enabled: model.isLoading == false, 148 | labelText: 'Confirmation Code', 149 | hintText: 'The code we sent you', 150 | errorText: model.emailErrorText, 151 | ), 152 | controller: _codeController, 153 | autocorrect: false, 154 | keyboardType: TextInputType.text, 155 | textInputAction: TextInputAction.done, 156 | focusNode: _passwordFocusNode, 157 | onEditingComplete: _submit, 158 | onChanged: model.updateCode, 159 | ), 160 | SizedBox( 161 | height: 8.0, 162 | ), 163 | ElevatedButton( 164 | onPressed: model.submitEnabled ? _submit : null, 165 | child: Text( 166 | model.primaryButtonText, 167 | ), 168 | ), 169 | SizedBox( 170 | height: 8.0, 171 | ), 172 | ]; 173 | } 174 | } 175 | -------------------------------------------------------------------------------- /lib/widgets/show_error_dialog.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:flutter/cupertino.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | Future showErrorDialog( 7 | BuildContext context, { 8 | @required String title, 9 | @required String content, 10 | String cancelActionText, 11 | @required String defaultActionText, 12 | }) { 13 | if (!Platform.isIOS) { 14 | return showDialog( 15 | barrierDismissible: false, 16 | context: context, 17 | builder: (context) => AlertDialog( 18 | title: Text(title), 19 | content: Text(content), 20 | actions: [ 21 | if (cancelActionText != null) 22 | TextButton( 23 | onPressed: () => Navigator.of(context).pop(false), 24 | child: Text(cancelActionText), 25 | ), 26 | TextButton( 27 | onPressed: () => Navigator.of(context).pop(true), 28 | child: Text(defaultActionText), 29 | ) 30 | ], 31 | ), 32 | ); 33 | } 34 | return showCupertinoDialog( 35 | context: context, 36 | builder: (context) => CupertinoAlertDialog( 37 | title: Text(title), 38 | content: Text(content), 39 | actions: [ 40 | if (cancelActionText != null) 41 | CupertinoDialogAction( 42 | onPressed: () => Navigator.of(context).pop(false), 43 | child: Text(cancelActionText), 44 | ), 45 | CupertinoDialogAction( 46 | onPressed: () => Navigator.of(context).pop(true), 47 | child: Text(defaultActionText), 48 | ) 49 | ], 50 | ), 51 | ); 52 | } 53 | -------------------------------------------------------------------------------- /lib/widgets/sign_in_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_amplify_auth_demo/models/buttons_enum.dart'; 3 | import 'package:font_awesome_flutter/font_awesome_flutter.dart'; 4 | 5 | class SocialSignInButton extends StatelessWidget { 6 | final Color color; 7 | final String text; 8 | final Color textColor; 9 | final double height; 10 | static const double borderRadius = 4.0; 11 | final VoidCallback onPressed; 12 | final Buttons button; 13 | 14 | const SocialSignInButton({ 15 | Key key, 16 | @required this.color, 17 | @required this.onPressed, 18 | this.height: 50, 19 | @required this.button, 20 | @required this.text, 21 | @required this.textColor, 22 | }) : super(key: key); 23 | @override 24 | Widget build(BuildContext context) { 25 | return SizedBox( 26 | height: height, 27 | child: ElevatedButton( 28 | onPressed: onPressed, 29 | style: ElevatedButton.styleFrom( 30 | primary: color, 31 | shape: const RoundedRectangleBorder( 32 | borderRadius: BorderRadius.all(Radius.circular(borderRadius))), 33 | ), 34 | child: buildRow(), 35 | ), 36 | ); 37 | } 38 | 39 | Row buildRow() { 40 | switch (button) { 41 | case Buttons.Google: 42 | return Row( 43 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 44 | children: [ 45 | Image.asset('images/google-logo.png'), 46 | Text( 47 | text, 48 | style: TextStyle(color: textColor, fontSize: 15), 49 | ), 50 | Opacity(opacity: 0.0, child: Image.asset('images/google-logo.png')), 51 | ], 52 | ); 53 | case Buttons.Email: 54 | return Row( 55 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 56 | children: [ 57 | Icon( 58 | Icons.email, 59 | ), 60 | Text( 61 | text, 62 | style: TextStyle(color: textColor, fontSize: 15), 63 | ), 64 | Opacity( 65 | opacity: 0.0, 66 | child: Icon( 67 | Icons.email, 68 | ), 69 | ), 70 | ], 71 | ); 72 | 73 | case Buttons.Facebook: 74 | return Row( 75 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 76 | children: [ 77 | Image.asset('images/facebook-logo.png'), 78 | Text( 79 | text, 80 | style: TextStyle(color: textColor, fontSize: 15), 81 | ), 82 | Opacity( 83 | opacity: 0.0, child: Image.asset('images/facebook-logo.png')), 84 | ], 85 | ); 86 | 87 | case Buttons.Amazon: 88 | return Row( 89 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 90 | children: [ 91 | Image.asset('images/amazon-logo.png'), 92 | Text( 93 | text, 94 | style: TextStyle(color: textColor, fontSize: 15), 95 | ), 96 | Opacity(opacity: 0.0, child: Image.asset('images/amazon-logo.png')), 97 | ], 98 | ); 99 | 100 | case Buttons.Apple: 101 | return Row( 102 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 103 | children: [ 104 | Icon( 105 | FontAwesomeIcons.apple, 106 | color: Colors.white, 107 | ), 108 | Text( 109 | text, 110 | style: TextStyle(color: textColor, fontSize: 15), 111 | ), 112 | Opacity( 113 | opacity: 0.0, 114 | child: Icon( 115 | FontAwesomeIcons.apple, 116 | ), 117 | ), 118 | ], 119 | ); 120 | } 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /media/youtube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/media/youtube.png -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | amplify_analytics_plugin_interface: 5 | dependency: transitive 6 | description: 7 | name: amplify_analytics_plugin_interface 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "0.1.1" 11 | amplify_api_plugin_interface: 12 | dependency: transitive 13 | description: 14 | name: amplify_api_plugin_interface 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "0.1.1" 18 | amplify_auth_cognito: 19 | dependency: "direct main" 20 | description: 21 | name: amplify_auth_cognito 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "0.1.1" 25 | amplify_auth_plugin_interface: 26 | dependency: transitive 27 | description: 28 | name: amplify_auth_plugin_interface 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "0.1.1" 32 | amplify_core: 33 | dependency: transitive 34 | description: 35 | name: amplify_core 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "0.1.1" 39 | amplify_datastore_plugin_interface: 40 | dependency: transitive 41 | description: 42 | name: amplify_datastore_plugin_interface 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "0.1.1" 46 | amplify_flutter: 47 | dependency: "direct main" 48 | description: 49 | name: amplify_flutter 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "0.1.1" 53 | amplify_storage_plugin_interface: 54 | dependency: transitive 55 | description: 56 | name: amplify_storage_plugin_interface 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "0.1.1" 60 | async: 61 | dependency: transitive 62 | description: 63 | name: async 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "2.5.0" 67 | boolean_selector: 68 | dependency: transitive 69 | description: 70 | name: boolean_selector 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "2.1.0" 74 | characters: 75 | dependency: transitive 76 | description: 77 | name: characters 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "1.1.0" 81 | charcode: 82 | dependency: transitive 83 | description: 84 | name: charcode 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "1.2.0" 88 | clock: 89 | dependency: transitive 90 | description: 91 | name: clock 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "1.1.0" 95 | collection: 96 | dependency: transitive 97 | description: 98 | name: collection 99 | url: "https://pub.dartlang.org" 100 | source: hosted 101 | version: "1.15.0" 102 | crypto: 103 | dependency: transitive 104 | description: 105 | name: crypto 106 | url: "https://pub.dartlang.org" 107 | source: hosted 108 | version: "3.0.1" 109 | cupertino_icons: 110 | dependency: "direct main" 111 | description: 112 | name: cupertino_icons 113 | url: "https://pub.dartlang.org" 114 | source: hosted 115 | version: "1.0.2" 116 | date_time_format: 117 | dependency: transitive 118 | description: 119 | name: date_time_format 120 | url: "https://pub.dartlang.org" 121 | source: hosted 122 | version: "1.1.1+1" 123 | fake_async: 124 | dependency: transitive 125 | description: 126 | name: fake_async 127 | url: "https://pub.dartlang.org" 128 | source: hosted 129 | version: "1.2.0" 130 | flutter: 131 | dependency: "direct main" 132 | description: flutter 133 | source: sdk 134 | version: "0.0.0" 135 | flutter_test: 136 | dependency: "direct dev" 137 | description: flutter 138 | source: sdk 139 | version: "0.0.0" 140 | font_awesome_flutter: 141 | dependency: "direct main" 142 | description: 143 | name: font_awesome_flutter 144 | url: "https://pub.dartlang.org" 145 | source: hosted 146 | version: "9.0.0" 147 | matcher: 148 | dependency: transitive 149 | description: 150 | name: matcher 151 | url: "https://pub.dartlang.org" 152 | source: hosted 153 | version: "0.12.10" 154 | meta: 155 | dependency: transitive 156 | description: 157 | name: meta 158 | url: "https://pub.dartlang.org" 159 | source: hosted 160 | version: "1.3.0" 161 | nested: 162 | dependency: transitive 163 | description: 164 | name: nested 165 | url: "https://pub.dartlang.org" 166 | source: hosted 167 | version: "1.0.0" 168 | path: 169 | dependency: transitive 170 | description: 171 | name: path 172 | url: "https://pub.dartlang.org" 173 | source: hosted 174 | version: "1.8.0" 175 | plugin_platform_interface: 176 | dependency: transitive 177 | description: 178 | name: plugin_platform_interface 179 | url: "https://pub.dartlang.org" 180 | source: hosted 181 | version: "2.0.0" 182 | provider: 183 | dependency: "direct main" 184 | description: 185 | name: provider 186 | url: "https://pub.dartlang.org" 187 | source: hosted 188 | version: "5.0.0" 189 | sky_engine: 190 | dependency: transitive 191 | description: flutter 192 | source: sdk 193 | version: "0.0.99" 194 | source_span: 195 | dependency: transitive 196 | description: 197 | name: source_span 198 | url: "https://pub.dartlang.org" 199 | source: hosted 200 | version: "1.8.0" 201 | stack_trace: 202 | dependency: transitive 203 | description: 204 | name: stack_trace 205 | url: "https://pub.dartlang.org" 206 | source: hosted 207 | version: "1.10.0" 208 | stream_channel: 209 | dependency: transitive 210 | description: 211 | name: stream_channel 212 | url: "https://pub.dartlang.org" 213 | source: hosted 214 | version: "2.1.0" 215 | string_scanner: 216 | dependency: transitive 217 | description: 218 | name: string_scanner 219 | url: "https://pub.dartlang.org" 220 | source: hosted 221 | version: "1.1.0" 222 | term_glyph: 223 | dependency: transitive 224 | description: 225 | name: term_glyph 226 | url: "https://pub.dartlang.org" 227 | source: hosted 228 | version: "1.2.0" 229 | test_api: 230 | dependency: transitive 231 | description: 232 | name: test_api 233 | url: "https://pub.dartlang.org" 234 | source: hosted 235 | version: "0.2.19" 236 | typed_data: 237 | dependency: transitive 238 | description: 239 | name: typed_data 240 | url: "https://pub.dartlang.org" 241 | source: hosted 242 | version: "1.3.0" 243 | uuid: 244 | dependency: transitive 245 | description: 246 | name: uuid 247 | url: "https://pub.dartlang.org" 248 | source: hosted 249 | version: "3.0.3" 250 | vector_math: 251 | dependency: transitive 252 | description: 253 | name: vector_math 254 | url: "https://pub.dartlang.org" 255 | source: hosted 256 | version: "2.1.0" 257 | sdks: 258 | dart: ">=2.12.0 <3.0.0" 259 | flutter: ">=1.20.0" 260 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_amplify_auth_demo 2 | description: A new Flutter project. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | # The following defines the version and build number for your application. 9 | # A version number is three numbers separated by dots, like 1.2.43 10 | # followed by an optional build number separated by a +. 11 | # Both the version and the builder number may be overridden in flutter 12 | # build by specifying --build-name and --build-number, respectively. 13 | # In Android, build-name is used as versionName while build-number used as versionCode. 14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 16 | # Read more about iOS versioning at 17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 18 | version: 1.0.0+1 19 | 20 | environment: 21 | sdk: ">=2.7.0 <3.0.0" 22 | 23 | dependencies: 24 | flutter: 25 | sdk: flutter 26 | provider: ^5.0.0 27 | amplify_flutter: ^0.1.1 28 | amplify_auth_cognito: ^0.1.1 29 | font_awesome_flutter: ^9.0.0 30 | 31 | 32 | 33 | 34 | 35 | # The following adds the Cupertino Icons font to your application. 36 | # Use with the CupertinoIcons class for iOS style icons. 37 | cupertino_icons: ^1.0.2 38 | 39 | dev_dependencies: 40 | flutter_test: 41 | sdk: flutter 42 | 43 | # For information on the generic Dart part of this file, see the 44 | # following page: https://dart.dev/tools/pub/pubspec 45 | 46 | # The following section is specific to Flutter. 47 | flutter: 48 | 49 | # The following line ensures that the Material Icons font is 50 | # included with your application, so that you can use the icons in 51 | # the material Icons class. 52 | uses-material-design: true 53 | 54 | # To add assets to your application, add an assets section, like this: 55 | assets: 56 | - images/facebook-logo.png 57 | - images/google-logo.png 58 | - images/amazon-logo.png 59 | 60 | # An image asset can refer to one or more resolution-specific "variants", see 61 | # https://flutter.dev/assets-and-images/#resolution-aware. 62 | 63 | # For details regarding adding assets from package dependencies, see 64 | # https://flutter.dev/assets-and-images/#from-packages 65 | 66 | # To add custom fonts to your application, add a fonts section here, 67 | # in this "flutter" section. Each entry in this list should have a 68 | # "family" key with the font family name, and a "fonts" key with a 69 | # list giving the asset and other descriptors for the font. For 70 | # example: 71 | # fonts: 72 | # - family: Schyler 73 | # fonts: 74 | # - asset: fonts/Schyler-Regular.ttf 75 | # - asset: fonts/Schyler-Italic.ttf 76 | # style: italic 77 | # - family: Trajan Pro 78 | # fonts: 79 | # - asset: fonts/TrajanPro.ttf 80 | # - asset: fonts/TrajanPro_Bold.ttf 81 | # weight: 700 82 | # 83 | # For details regarding fonts from package dependencies, 84 | # see https://flutter.dev/custom-fonts/#from-packages 85 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:flutter_amplify_auth_demo/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/offlineprogrammer/flutter_amplify_auth_demo/895c2e83948844986bcd248209c30bb1bdfdfcba/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | flutter_amplify_auth_demo 30 | 31 | 32 | 33 | 36 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "flutter_amplify_auth_demo", 3 | "short_name": "flutter_amplify_auth_demo", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | --------------------------------------------------------------------------------