From 51d2efaad9d8b35695e67654b1219df8a1c3c859 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Wed, 9 Oct 2019 21:50:24 +0200 Subject: [PATCH] ios - GitHostSetup: Add a back button on the top left There is no way to exit the host setup otherwise. In Android, there is the back button, but that doesn't exist in ios. This took me way too long to implement, and even now, I'm not convinced that the button looks right. --- lib/screens/githostsetup_screens.dart | 46 +++++++++++++++++---------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/lib/screens/githostsetup_screens.dart b/lib/screens/githostsetup_screens.dart index 8fdb4764..7ce6bb00 100644 --- a/lib/screens/githostsetup_screens.dart +++ b/lib/screens/githostsetup_screens.dart @@ -265,24 +265,38 @@ class GitHostSetupScreenState extends State { }, ); + var body = Container( + width: double.infinity, + height: double.infinity, + child: Stack( + alignment: FractionalOffset.bottomCenter, + children: [ + pageView, + DotsIndicator( + dotsCount: _pageCount, + position: _currentPageIndex, + decorator: DotsDecorator( + activeColor: Theme.of(context).primaryColorDark, + ), + ), + ], + ), + padding: EdgeInsets.all(16.0), + ); + var scaffold = Scaffold( - body: Container( - width: double.infinity, - height: double.infinity, - child: Stack( - alignment: FractionalOffset.bottomCenter, - children: [ - pageView, - DotsIndicator( - dotsCount: _pageCount, - position: _currentPageIndex, - decorator: DotsDecorator( - activeColor: Theme.of(context).primaryColorDark, + body: Stack( + children: [ + body, + if (Platform.isIOS) + InkWell( + child: Container( + child: Icon(Icons.arrow_back, size: 32.0), + padding: EdgeInsets.all(8.0), ), - ) - ], - ), - padding: EdgeInsets.all(16.0), + onTap: () => Navigator.of(context).pop(), + ), + ], ), );