From 5da4c0ade257fc16d6a6db6668555bc5437f20ef Mon Sep 17 00:00:00 2001 From: Moritz Fink Date: Fri, 16 Sep 2022 06:32:20 +0200 Subject: [PATCH 1/4] Use "flutter analyze" instead of "dart analyze" for static code analysis --- .github/workflows/dart.yml | 2 +- lib/src/auth_config/auth_config_reader.dart | 2 +- pubspec.yaml | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index c205519..37de1a8 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -24,7 +24,7 @@ jobs: run: dart format --output=none --set-exit-if-changed . - name: Analyze project source - run: dart analyze + run: flutter analyze - name: Run tests run: flutter test diff --git a/lib/src/auth_config/auth_config_reader.dart b/lib/src/auth_config/auth_config_reader.dart index aca2b13..ca20f7a 100644 --- a/lib/src/auth_config/auth_config_reader.dart +++ b/lib/src/auth_config/auth_config_reader.dart @@ -25,7 +25,7 @@ class AuthConfigReader { return File(file.path); } } - ; + throw FlutterAmplifyAuthUiException(''' Could not find "parameters.json"! Please check if you have already configured Amplify Auth for this project.'''); diff --git a/pubspec.yaml b/pubspec.yaml index 9d739e4..11755d5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -19,5 +19,6 @@ dependencies: path: ^1.8.0 dev_dependencies: + lints: ^2.0.0 pedantic: ^1.9.0 test: ^1.14.4 From b8dac39c5c7164934d793d93e3d8580e08ebfa12 Mon Sep 17 00:00:00 2001 From: Moritz Fink Date: Sat, 13 May 2023 21:28:24 +0200 Subject: [PATCH 2/4] Prepare web support release --- .github/workflows/dart.yml | 1 - .gitignore | 2 ++ CHANGELOG.md | 7 ++++++- README.md | 2 +- analysis_options.yaml | 1 - lib/templates/sign_up/sign_up_page.dart | 3 +-- pubspec.yaml | 17 ++++++++--------- 7 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 37de1a8..2f3785e 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -2,7 +2,6 @@ name: Dart on: push: - branches: [ main, develop ] pull_request: branches: [ main, develop ] diff --git a/.gitignore b/.gitignore index cba6530..c6227a6 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,8 @@ example/target # Files and directories created by pub .dart_tool/ .packages +.flutter-plugins +.flutter-plugins-dependencies # Omit commiting pubspec.lock for library packages: # https://dart.dev/guides/libraries/private-files#pubspeclock diff --git a/CHANGELOG.md b/CHANGELOG.md index 353101d..f1271f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ -## 0.1.6 (2022-09-15) +## 1.1.0 (2023-05-13) + +- Use same release version as amplify_flutter package +- Added support for web platform + +- ## 0.1.6 (2022-09-15) - Fix imports in templates - Use CognitoUserAttributeKey attributes for sign up diff --git a/README.md b/README.md index 126dc72..614b40c 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ into your project. To use this plugin, add `flutter_amplify_auth_ui` as a `dev_dependency` in your pubspec.yaml: ``` dev_dependencies: - flutter_amplify_auth_ui: ^0.1.6 + flutter_amplify_auth_ui: ^1.1.0 ``` Run `flutter pub get` to install the plugin. diff --git a/analysis_options.yaml b/analysis_options.yaml index a686c1b..99ac01b 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,7 +1,6 @@ # Defines a default set of lint rules enforced for # projects at Google. For details and rationale, # see https://github.com/dart-lang/pedantic#enabled-lints. -include: package:pedantic/analysis_options.yaml # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. # Uncomment to specify additional rules. diff --git a/lib/templates/sign_up/sign_up_page.dart b/lib/templates/sign_up/sign_up_page.dart index 0189177..646ff66 100644 --- a/lib/templates/sign_up/sign_up_page.dart +++ b/lib/templates/sign_up/sign_up_page.dart @@ -1,4 +1,3 @@ -import 'package:amplify_auth_cognito/amplify_auth_cognito.dart'; import 'package:amplify_flutter/amplify_flutter.dart'; import 'package:flutter/material.dart'; @@ -525,7 +524,7 @@ class _SignUpPageState extends State { username: _phoneNumberController.text.trim(), +++END usernameAttributes[phone_number]+++*/ password: _passwordController.text.trim(), - options: CognitoSignUpOptions( + options: SignUpOptions( userAttributes: Map.from({ /*+++START requiredAttributes[email]+++*/ CognitoUserAttributeKey.email: _emailController.text.trim(), diff --git a/pubspec.yaml b/pubspec.yaml index 11755d5..6f65b41 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,24 +1,23 @@ name: flutter_amplify_auth_ui description: Flutter plugin that automatically generates authentication widget templates based on your Amplify CLI Authentication configuration. -version: 0.1.6 +version: 1.1.0 homepage: https://github.com/finkmoritz/flutter_amplify_auth_ui repository: https://github.com/finkmoritz/flutter_amplify_auth_ui issue_tracker: https://github.com/finkmoritz/flutter_amplify_auth_ui/issues documentation: https://github.com/finkmoritz/flutter_amplify_auth_ui/blob/main/README.md environment: - sdk: '>=2.12.3 <3.0.0' - flutter: '>=2.8.0' + sdk: ^3.0.0 + flutter: '>=3.10.0' dependencies: flutter: sdk: flutter - amplify_flutter: '>=0.6.0 <1.0.0' - amplify_auth_cognito: '>=0.6.0 <1.0.0' - path: ^1.8.0 + amplify_flutter: ^1.1.0 + amplify_auth_cognito: ^1.1.0 + path: ^1.8.3 dev_dependencies: - lints: ^2.0.0 - pedantic: ^1.9.0 - test: ^1.14.4 + lints: ^2.1.0 + test: ^1.24.2 From e14187de813b7307a226dcec11f34afc9e566337 Mon Sep 17 00:00:00 2001 From: Moritz Fink Date: Sat, 13 May 2023 22:37:25 +0200 Subject: [PATCH 3/4] Fix auth providers reading --- lib/src/auth_config/auth_config.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/auth_config/auth_config.dart b/lib/src/auth_config/auth_config.dart index 247a0b2..91ed624 100644 --- a/lib/src/auth_config/auth_config.dart +++ b/lib/src/auth_config/auth_config.dart @@ -20,7 +20,7 @@ class AuthConfig { allowUnauthenticatedIdentities: json['allowUnauthenticatedIdentities'], requiredAttributes: _getAsList(json, 'requiredAttributes'), usernameAttributes: _getAsList(json, 'usernameAttributes'), - authProviders: _getAsList(json, 'authProviders'), + authProviders: _getAsList(json, 'authProvidersUserPool'), mfaConfiguration: json['mfaConfiguration'], mfaTypes: _getAsList(json, 'mfaTypes'), ); @@ -36,7 +36,7 @@ class AuthConfig { "allowUnauthenticatedIdentities": $allowUnauthenticatedIdentities, "requiredAttributes": $requiredAttributes, "usernameAttributes": $usernameAttributes, - "authProviders": $authProviders, + "authProvidersUserPool": $authProviders, "mfaConfiguration": $mfaConfiguration, "mfaTypes": $mfaTypes, '''; From bdf41452492d9369f4fd3f6cda43f6884b4f3ff6 Mon Sep 17 00:00:00 2001 From: Moritz Fink Date: Sat, 13 May 2023 22:41:20 +0200 Subject: [PATCH 4/4] Provide SDK version boundaries --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 6f65b41..5dca130 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -7,7 +7,7 @@ issue_tracker: https://github.com/finkmoritz/flutter_amplify_auth_ui/issues documentation: https://github.com/finkmoritz/flutter_amplify_auth_ui/blob/main/README.md environment: - sdk: ^3.0.0 + sdk: ">=3.0.0 <4.0.0" flutter: '>=3.10.0' dependencies: