I have a Flutter app that should be portrait-only on phones and tablets.
What I want:
-
Even if the user holds the device in landscape, the app should stay in portrait UI
-
I am not able to create a landscape layout
-
I want the app to still look fullscreen (no black bars/letterboxing)
Current setup (Flutter):
Future main() async {
WidgetsFlutterBinding.ensureInitialized();
await SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
]);
runApp(const MyApp());
}
iOS Info.plist currently supports both portrait and landscape (iPad too).
Problem:
-
On iPad simulator and some Android tablets, the app still rotates to landscape.
-
If I remove landscape orientations, the app stays portrait but in landscape device orientation I get black bars / letterboxing (the portrait UI is centered with empty areas around it).
-
I want portrait UI fullscreen even in landscape (no letterboxing). Like in some games or apps.
Questions:
-
Is it technically possible on iOS and Android to keep a portrait UI fullscreen when the device is landscape, without supporting a landscape layout?
-
If not, what is the recommended approach for tablets? (e.g. allow landscape but keep a portrait-like centered layout, or opt out of iPad multitasking, etc.)
Any guidance or platform limitations explanation would help.
