From fda9c2a63a8c7c0f075b38c00152958d4635b6af Mon Sep 17 00:00:00 2001 From: Felix Angelov Date: Fri, 26 Jul 2024 00:04:45 -0500 Subject: [PATCH] minor updates --- .../ios/Flutter/AppFrameworkInfo.plist | 2 +- .../ios/Runner.xcodeproj/project.pbxproj | 8 +++--- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- .../lib/home/view/home_page.dart | 5 +--- .../lib/login/view/login_form.dart | 28 +++++++++---------- 5 files changed, 20 insertions(+), 25 deletions(-) diff --git a/examples/flutter_login/ios/Flutter/AppFrameworkInfo.plist b/examples/flutter_login/ios/Flutter/AppFrameworkInfo.plist index 9625e105df3..7c569640062 100644 --- a/examples/flutter_login/ios/Flutter/AppFrameworkInfo.plist +++ b/examples/flutter_login/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 11.0 + 12.0 diff --git a/examples/flutter_login/ios/Runner.xcodeproj/project.pbxproj b/examples/flutter_login/ios/Runner.xcodeproj/project.pbxproj index 7d9f6857d38..48a9cdaeff2 100644 --- a/examples/flutter_login/ios/Runner.xcodeproj/project.pbxproj +++ b/examples/flutter_login/ios/Runner.xcodeproj/project.pbxproj @@ -168,7 +168,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 331C8080294A63A400263BE5 = { @@ -344,7 +344,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -471,7 +471,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -520,7 +520,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/examples/flutter_login/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/examples/flutter_login/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index e42adcb34c2..8e3ca5dfe19 100644 --- a/examples/flutter_login/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/examples/flutter_login/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ bloc.state.username.displayError, ); return TextField( key: const Key('loginForm_usernameInput_textField'), - onChanged: (username) => - context.read().add(LoginUsernameChanged(username)), + onChanged: (username) { + context.read().add(LoginUsernameChanged(username)); + }, decoration: InputDecoration( labelText: 'username', - errorText: usernameDisplayError != null ? 'invalid username' : null, + errorText: displayError != null ? 'invalid username' : null, ), ); } @@ -57,18 +58,19 @@ class _UsernameInput extends StatelessWidget { class _PasswordInput extends StatelessWidget { @override Widget build(BuildContext context) { - final passwordDisplayError = context.select( + final displayError = context.select( (LoginBloc bloc) => bloc.state.password.displayError, ); return TextField( key: const Key('loginForm_passwordInput_textField'), - onChanged: (password) => - context.read().add(LoginPasswordChanged(password)), + onChanged: (password) { + context.read().add(LoginPasswordChanged(password)); + }, obscureText: true, decoration: InputDecoration( labelText: 'password', - errorText: passwordDisplayError != null ? 'invalid password' : null, + errorText: displayError != null ? 'invalid password' : null, ), ); } @@ -81,18 +83,14 @@ class _LoginButton extends StatelessWidget { (LoginBloc bloc) => bloc.state.status.isInProgress, ); - final isValid = context.select( - (LoginBloc bloc) => bloc.state.isValid, - ); - if (isInProgress) return const CircularProgressIndicator(); + final isValid = context.select((LoginBloc bloc) => bloc.state.isValid); + return ElevatedButton( key: const Key('loginForm_continue_raisedButton'), onPressed: isValid - ? () { - context.read().add(const LoginSubmitted()); - } + ? () => context.read().add(const LoginSubmitted()) : null, child: const Text('Login'), );