问题
After successfully login the user redirected to the Home page but when the user clicks on the browser back button it easily redirected to the login screen. What should I do to disable backward redirection?
回答1:
class SecondPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
/// Hope WillPopScope will do the job for you.
return WillPopScope(
onWillPop: () async => null,
child: Scaffold(
body: Center(
child: Text('asd'),
),
),
);
}
}
来源:https://stackoverflow.com/questions/59763779/flutter-web-how-to-disable-backward-button-of-browser-in-flutter-web-applicatio