diff --git a/CHANGELOG.md b/CHANGELOG.md index 453c3a1..ebe4a11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [1.0.4] - 07/06/2022 + +* Updated example app +* Updated dependencies +* Fixed linter warnings + ## [1.0.3] - 03/05/2022 * Updated example app diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index 3f5da04..5dae278 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -1,7 +1,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - phone_auth_handler_demo + FirebasePhoneAuthHandler Demo CFBundlePackageType APPL CFBundleShortVersionString diff --git a/example/lib/screens/authentication_screen.dart b/example/lib/screens/authentication_screen.dart index c36fedf..9a5a60c 100644 --- a/example/lib/screens/authentication_screen.dart +++ b/example/lib/screens/authentication_screen.dart @@ -12,6 +12,7 @@ class AuthenticationScreen extends StatefulWidget { }) : super(key: key); @override + // ignore: library_private_types_in_public_api _AuthenticationScreenState createState() => _AuthenticationScreenState(); } @@ -55,10 +56,6 @@ class _AuthenticationScreenState extends State { ), const SizedBox(height: 15), EasyContainer( - child: const Text( - 'Verify', - style: TextStyle(fontSize: 18), - ), width: double.infinity, onTap: () async { if (isNullOrBlank(phoneNumber) || @@ -72,6 +69,10 @@ class _AuthenticationScreenState extends State { ); } }, + child: const Text( + 'Verify', + style: TextStyle(fontSize: 18), + ), ), ], ), diff --git a/example/lib/screens/home_screen.dart b/example/lib/screens/home_screen.dart index 6a47767..57dc322 100644 --- a/example/lib/screens/home_screen.dart +++ b/example/lib/screens/home_screen.dart @@ -40,6 +40,8 @@ class HomeScreen extends StatelessWidget { onTap: () async { await FirebasePhoneAuthHandler.signOut(context); showSnackBar('Logged out successfully!'); + + // ignore: use_build_context_synchronously Navigator.pushNamedAndRemoveUntil( context, AuthenticationScreen.id, diff --git a/example/lib/screens/splash_screen.dart b/example/lib/screens/splash_screen.dart index 3838446..c8b51d3 100644 --- a/example/lib/screens/splash_screen.dart +++ b/example/lib/screens/splash_screen.dart @@ -12,6 +12,7 @@ class SplashScreen extends StatefulWidget { }) : super(key: key); @override + // ignore: library_private_types_in_public_api _SplashScreenState createState() => _SplashScreenState(); } @@ -22,6 +23,7 @@ class _SplashScreenState extends State { await Future.delayed(Duration.zero); final isLoggedIn = Globals.firebaseUser != null; + if (!mounted) return; Navigator.pushReplacementNamed( context, isLoggedIn ? HomeScreen.id : AuthenticationScreen.id, diff --git a/example/lib/screens/verify_phone_number_screen.dart b/example/lib/screens/verify_phone_number_screen.dart index 4013f83..a47f141 100644 --- a/example/lib/screens/verify_phone_number_screen.dart +++ b/example/lib/screens/verify_phone_number_screen.dart @@ -29,20 +29,20 @@ class _VerifyPhoneNumberScreenState extends State @override void initState() { scrollController = ScrollController(); - WidgetsBinding.instance?.addObserver(this); + WidgetsBinding.instance.addObserver(this); super.initState(); } @override void dispose() { - WidgetsBinding.instance?.removeObserver(this); + WidgetsBinding.instance.removeObserver(this); scrollController.dispose(); super.dispose(); } @override void didChangeMetrics() { - final bottomViewInsets = WidgetsBinding.instance!.window.viewInsets.bottom; + final bottomViewInsets = WidgetsBinding.instance.window.viewInsets.bottom; isKeyboardVisible = bottomViewInsets > 0; } @@ -101,18 +101,18 @@ class _VerifyPhoneNumberScreenState extends State actions: [ if (controller.codeSent) TextButton( - child: Text( - controller.timerIsActive - ? '${controller.timerCount.inSeconds}s' - : 'Resend', - style: const TextStyle(color: Colors.blue, fontSize: 18), - ), onPressed: controller.timerIsActive ? null : () async { log(VerifyPhoneNumberScreen.id, msg: 'Resend OTP'); await controller.sendOTP(); }, + child: Text( + controller.timerIsActive + ? '${controller.timerCount.inSeconds}s' + : 'Resend', + style: const TextStyle(color: Colors.blue, fontSize: 18), + ), ), const SizedBox(width: 5), ], diff --git a/example/lib/widgets/pin_input_field.dart b/example/lib/widgets/pin_input_field.dart index 2ca5bd1..54c371b 100644 --- a/example/lib/widgets/pin_input_field.dart +++ b/example/lib/widgets/pin_input_field.dart @@ -14,6 +14,7 @@ class PinInputField extends StatefulWidget { }) : super(key: key); @override + // ignore: library_private_types_in_public_api _PinInputFieldState createState() => _PinInputFieldState(); } diff --git a/example/pubspec.lock b/example/pubspec.lock index 661aefe..3dbbe0c 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -42,70 +42,70 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" easy_container: dependency: "direct main" description: name: easy_container url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.0.4" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" firebase_auth: dependency: transitive description: name: firebase_auth url: "https://pub.dartlang.org" source: hosted - version: "3.3.16" + version: "3.3.19" firebase_auth_platform_interface: dependency: transitive description: name: firebase_auth_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "6.2.4" + version: "6.2.7" firebase_auth_web: dependency: transitive description: name: firebase_auth_web url: "https://pub.dartlang.org" source: hosted - version: "3.3.13" + version: "3.3.16" firebase_core: dependency: "direct main" description: name: firebase_core url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.17.1" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "4.2.5" + version: "4.4.0" firebase_core_web: dependency: transitive description: name: firebase_core_web url: "https://pub.dartlang.org" source: hosted - version: "1.6.2" + version: "1.6.4" firebase_phone_auth_handler: dependency: "direct main" description: path: ".." relative: true source: path - version: "1.0.3" + version: "1.0.4" flutter: dependency: "direct main" description: flutter @@ -117,7 +117,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -155,14 +155,14 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" lints: dependency: transitive description: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" matcher: dependency: transitive description: @@ -176,7 +176,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -197,14 +197,14 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" pinput: dependency: "direct main" description: name: pinput url: "https://pub.dartlang.org" source: hosted - version: "2.2.7" + version: "2.2.10" plugin_platform_interface: dependency: transitive description: @@ -218,7 +218,7 @@ packages: name: provider url: "https://pub.dartlang.org" source: hosted - version: "6.0.2" + version: "6.0.3" sky_engine: dependency: transitive description: flutter @@ -237,7 +237,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -272,7 +272,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" + version: "0.4.9" typed_data: dependency: transitive description: @@ -286,7 +286,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" sdks: - dart: ">=2.16.1 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" flutter: ">=2.5.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 77fdd80..74c1a5d 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -12,9 +12,9 @@ dependencies: flutter: sdk: flutter - pinput: ^2.2.7 - firebase_core: ^1.15.0 - easy_container: ^1.0.3 + pinput: ^2.2.10 + firebase_core: ^1.17.1 + easy_container: ^1.0.4 intl_phone_field: ^3.1.0 firebase_phone_auth_handler: path: "../" @@ -23,7 +23,7 @@ dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.4 + flutter_lints: ^2.0.1 flutter: diff --git a/example/web/index.html b/example/web/index.html index 20fa714..0ed0486 100644 --- a/example/web/index.html +++ b/example/web/index.html @@ -29,7 +29,7 @@ - phone_auth_handler_demo + FirebasePhoneAuthHandler Demo diff --git a/lib/src/auth_handler.dart b/lib/src/auth_handler.dart index b12174b..1d13479 100644 --- a/lib/src/auth_handler.dart +++ b/lib/src/auth_handler.dart @@ -95,6 +95,7 @@ class FirebasePhoneAuthHandler extends StatefulWidget { FirebasePhoneAuthController.of(context, listen: false).signOut(); @override + // ignore: library_private_types_in_public_api _FirebasePhoneAuthHandlerState createState() => _FirebasePhoneAuthHandlerState(); } @@ -103,22 +104,22 @@ class _FirebasePhoneAuthHandlerState extends State { @override void initState() { (() async { - final _con = FirebasePhoneAuthController.of(context, listen: false); + final con = FirebasePhoneAuthController.of(context, listen: false); - RecaptchaVerifier? _captcha; + RecaptchaVerifier? captcha; if (widget.recaptchaVerifierForWebProvider != null) { - _captcha = widget.recaptchaVerifierForWebProvider!(kIsWeb); + captcha = widget.recaptchaVerifierForWebProvider!(kIsWeb); } - _con.setData( + con.setData( phoneNumber: widget.phoneNumber, onLoginSuccess: widget.onLoginSuccess, onLoginFailed: widget.onLoginFailed, timeOutDuration: widget.timeOutDuration, - recaptchaVerifierForWeb: _captcha, + recaptchaVerifierForWeb: captcha, ); - await _con.sendOTP(); + await con.sendOTP(); })(); super.initState(); } diff --git a/pubspec.lock b/pubspec.lock index ef84c2a..818db71 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -42,35 +42,35 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" firebase_auth: dependency: "direct main" description: name: firebase_auth url: "https://pub.dartlang.org" source: hosted - version: "3.3.16" + version: "3.3.19" firebase_auth_platform_interface: dependency: transitive description: name: firebase_auth_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "6.2.4" + version: "6.2.7" firebase_auth_web: dependency: transitive description: name: firebase_auth_web url: "https://pub.dartlang.org" source: hosted - version: "3.3.13" + version: "3.3.16" firebase_core: dependency: transitive description: @@ -84,14 +84,14 @@ packages: name: firebase_core_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "4.2.5" + version: "4.4.0" firebase_core_web: dependency: transitive description: name: firebase_core_web url: "https://pub.dartlang.org" source: hosted - version: "1.6.2" + version: "1.6.4" flutter: dependency: "direct main" description: flutter @@ -103,7 +103,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -134,14 +134,14 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" lints: dependency: transitive description: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" matcher: dependency: transitive description: @@ -155,7 +155,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -176,7 +176,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" plugin_platform_interface: dependency: transitive description: @@ -190,7 +190,7 @@ packages: name: provider url: "https://pub.dartlang.org" source: hosted - version: "6.0.2" + version: "6.0.3" sky_engine: dependency: transitive description: flutter @@ -202,7 +202,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -237,7 +237,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" + version: "0.4.9" typed_data: dependency: transitive description: @@ -251,7 +251,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" sdks: - dart: ">=2.16.0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" flutter: ">=1.17.0" diff --git a/pubspec.yaml b/pubspec.yaml index 94374ad..1046034 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: firebase_phone_auth_handler description: An easy-to-use firebase phone authentication package to easily send and verify OTP's with auto-fetch OTP support via SMS. Supports web out of the box. -version: 1.0.3 +version: 1.0.4 homepage: https://github.com/rithik-dev/firebase_phone_auth_handler environment: @@ -11,14 +11,14 @@ dependencies: flutter: sdk: flutter - firebase_auth: ^3.3.16 - provider: ^6.0.2 + firebase_auth: ^3.3.19 + provider: ^6.0.3 dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.4 + flutter_lints: ^2.0.1 false_secrets: - /example/android/app/google-services.json