mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-24 11:15:25 +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,
|
key: _scaffoldKey,
|
||||||
body: new Container(
|
body: new Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
@ -202,6 +202,20 @@ class OnBoardingScreenState extends State<OnBoardingScreen> {
|
|||||||
padding: EdgeInsets.all(16.0),
|
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() {
|
void setPageInputUrlDone() {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: journal
|
name: journal
|
||||||
description: A Journaling App Built on top of Git
|
description: A Journaling App Built on top of Git
|
||||||
version: 1.0.0+3
|
version: 1.0.0+5
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
|
Reference in New Issue
Block a user