I am trying to disable the landscape mode for phone users on flutter web. I have used this code to disable it, well, it works when I run the project as an app, but it doesn't work for the web project.
Widget build(BuildContext context) => ResponsiveSizer(
builder: (context, orientation, screenType) {
if (screenType == ScreenType.mobile) {
SystemChrome.setPreferredOrientations(
[DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);
}
return MaterialApp(
title: 'App Title',
debugShowCheckedModeBanner: false,
theme: AppTheme.lightTheme,
home: const HomePage(),
);
},
);
Any idea how to achieve this?