info: handle back button to image page
This commit is contained in:
parent
3ba9e5f5e6
commit
714cea3cd2
1 changed files with 63 additions and 59 deletions
|
@ -30,13 +30,7 @@ class FullscreenPage extends AnimatedWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return WillPopScope(
|
||||
onWillPop: () {
|
||||
Screen.keepOn(false);
|
||||
SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values);
|
||||
return Future.value(true);
|
||||
},
|
||||
child: Scaffold(
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.black,
|
||||
body: FullscreenBody(
|
||||
collection: collection,
|
||||
|
@ -71,7 +65,6 @@ class FullscreenPage extends AnimatedWidget {
|
|||
// ],
|
||||
// ),
|
||||
// ),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -145,7 +138,17 @@ class FullscreenBodyState extends State<FullscreenBody> with SingleTickerProvide
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final entry = entries[_currentHorizontalPage];
|
||||
return Stack(
|
||||
return WillPopScope(
|
||||
onWillPop: () {
|
||||
if (_currentVerticalPage == 1) {
|
||||
goToVerticalPage(0);
|
||||
return Future.value(false);
|
||||
}
|
||||
Screen.keepOn(false);
|
||||
SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values);
|
||||
return Future.value(true);
|
||||
},
|
||||
child: Stack(
|
||||
children: [
|
||||
PageView(
|
||||
scrollDirection: Axis.vertical,
|
||||
|
@ -192,6 +195,7 @@ class FullscreenBodyState extends State<FullscreenBody> with SingleTickerProvide
|
|||
)
|
||||
]
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue