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:
@ -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:
|
||||
|
Reference in New Issue
Block a user