From 2bfd05a532ae06c44c757feb876ff156b4843562 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Thu, 18 Jul 2019 01:13:39 +0200 Subject: [PATCH] Fix new flutter analyze problems Flutter analyze seems to have gotten smarter --- lib/screens/githostsetup_clone_url.dart | 4 ++++ lib/screens/githostsetup_screens.dart | 7 ++++--- lib/screens/settings_screen.dart | 2 ++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/screens/githostsetup_clone_url.dart b/lib/screens/githostsetup_clone_url.dart index 4a00ae51..1f6d33fe 100644 --- a/lib/screens/githostsetup_clone_url.dart +++ b/lib/screens/githostsetup_clone_url.dart @@ -62,6 +62,8 @@ class GitCloneUrlPageState extends State { if (!regExp.hasMatch(value)) { return "Invalid Input"; } + + return null; }, focusNode: inputFormFocus, textInputAction: TextInputAction.done, @@ -158,6 +160,8 @@ class GitCloneUrlKnownProviderPageState if (!regExp.hasMatch(value)) { return "Invalid Input"; } + + return null; }, focusNode: inputFormFocus, textInputAction: TextInputAction.done, diff --git a/lib/screens/githostsetup_screens.dart b/lib/screens/githostsetup_screens.dart index f7d35eff..8a1d5ec1 100644 --- a/lib/screens/githostsetup_screens.dart +++ b/lib/screens/githostsetup_screens.dart @@ -286,15 +286,16 @@ class GitHostSetupScreenState extends State { ); return WillPopScope( - onWillPop: () { + onWillPop: () async { if (_currentPageIndex != 0) { pageController.previousPage( duration: Duration(milliseconds: 200), curve: Curves.easeIn, ); - } else { - Navigator.pop(context); + return false; } + + return true; }, child: scaffold, ); diff --git a/lib/screens/settings_screen.dart b/lib/screens/settings_screen.dart index 78cfbda9..969fd857 100644 --- a/lib/screens/settings_screen.dart +++ b/lib/screens/settings_screen.dart @@ -52,6 +52,7 @@ class SettingsListState extends State { if (value.isEmpty) { return 'Please enter a name'; } + return null; }, textInputAction: TextInputAction.done, onFieldSubmitted: saveGitAuthor, @@ -89,6 +90,7 @@ class SettingsListState extends State { if (!emailValid) { return 'Please enter a valid email'; } + return null; }, textInputAction: TextInputAction.done, onFieldSubmitted: saveGitAuthorEmail,