I use this code for flutter app when I press the back button from home screen in android device than it go back to splash screen. How can I stop this?
abstract class Routes {
Routes._();
static const HOME = _Paths.HOME;
}
abstract class _Paths {
_Paths._();
static const HOME = '/home';
}
class AppPages {
AppPages._();
static const INITIAL = Routes.HOME;
static final routes = [
GetPage(
name: _Paths.HOME,
page: () => const SplashView(),
binding: HomeBinding(),
),
];
}
2
Answers
Try wrapping your entire screen with this custom widget (recommend extracting it to its own file tho and just calling it by name):
… then just set the
blocking
bool to be eithertrue
orfalse
.i use Go_route package to manage navigation .. and i get rid of the onboarding page like :enter image description here