1
0
mirror of https://github.com/GitJournal/GitJournal.git synced 2025-07-23 02:07:26 +08:00

OnBoarding: The back button should not result in the app quitting

This commit is contained in:
Vishesh Handa
2019-01-17 18:12:32 +01:00
parent a2358a84cc
commit a24837314c
2 changed files with 16 additions and 2 deletions

@ -183,7 +183,7 @@ class OnBoardingScreenState extends State<OnBoardingScreen> {
},
);
return new Scaffold(
var scaffold = new Scaffold(
key: _scaffoldKey,
body: new Container(
width: double.infinity,
@ -202,6 +202,20 @@ class OnBoardingScreenState extends State<OnBoardingScreen> {
padding: EdgeInsets.all(16.0),
),
);
return new WillPopScope(
onWillPop: () {
if (_currentPageIndex != 0) {
pageController.previousPage(
duration: Duration(milliseconds: 200),
curve: Curves.easeIn,
);
} else {
SystemChannels.platform.invokeMethod('SystemNavigator.pop');
}
},
child: scaffold,
);
}
void setPageInputUrlDone() {

@ -1,6 +1,6 @@
name: journal
description: A Journaling App Built on top of Git
version: 1.0.0+3
version: 1.0.0+5
dependencies:
flutter: