I would like to set a white screen when someone resizes the height of their tab to a small size It works for the initial route however, I would like to do this for all my screens
Here is my code
class _ExcelitState extends State<Excelit> {
@override
Widget build(BuildContext context) {
return MaterialApp(
initialRoute: '/',
key: navigatorKey,
debugShowCheckedModeBanner: false,
onUnknownRoute: (RouteSettings settings) {
return MaterialPageRoute<void>(
settings: settings,
builder: (BuildContext context) =>
const Scaffold(body: Center(child: Text('Page Not Found!!!'))),
);
},
// navigatorObservers: [observer],
routes: {
'/': (context) => (kIsWeb && setHeight(context, 0.01) <= 5)
? const EmptyScreen()
: const LoginScreen(),
},
);
}
}
class EmptyScreen extends StatelessWidget {
const EmptyScreen({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(backgroundColor: kBackgroundColor,);
}
}