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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return WillPopScope(
|
return Scaffold(
|
||||||
onWillPop: () {
|
|
||||||
Screen.keepOn(false);
|
|
||||||
SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values);
|
|
||||||
return Future.value(true);
|
|
||||||
},
|
|
||||||
child: Scaffold(
|
|
||||||
backgroundColor: Colors.black,
|
backgroundColor: Colors.black,
|
||||||
body: FullscreenBody(
|
body: FullscreenBody(
|
||||||
collection: collection,
|
collection: collection,
|
||||||
|
@ -71,7 +65,6 @@ class FullscreenPage extends AnimatedWidget {
|
||||||
// ],
|
// ],
|
||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -145,7 +138,17 @@ class FullscreenBodyState extends State<FullscreenBody> with SingleTickerProvide
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final entry = entries[_currentHorizontalPage];
|
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: [
|
children: [
|
||||||
PageView(
|
PageView(
|
||||||
scrollDirection: Axis.vertical,
|
scrollDirection: Axis.vertical,
|
||||||
|
@ -192,6 +195,7 @@ class FullscreenBodyState extends State<FullscreenBody> with SingleTickerProvide
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue