I have an issue that even when I'm on the main page, the user can still swipe back (from the edge) and hence end up on a black page, how do I prevent this?
Best regards
There's some more info here: https://api.flutter.dev/flutter/widgets/ModalRoute/addScopedWillPopCallback.html
@override
Widget build(BuildContext context) {
return WillPopScope(//forbidden swipe in iOS(my ThemeData(platform: TargetPlatform.iOS,)
onWillPop: ()async {
return !(Navigator.of(context).userGestureInProgress);
},
child: <your child>,
);
}