Home > Back-end >  Whitespace in bottom of my Flutter App when I run on emulator
Whitespace in bottom of my Flutter App when I run on emulator

Time:01-14

When I launch my app with the smartphone emulator I get a white space at the bottom :

enter image description here

I tried to add this line in my Scaffold but doesn't seems to work :

resizeToAvoidBottomInset: false

CodePudding user response:

It looks like the white space is coming from your device navigation bar.

Try to set SystemChrome.setEnabledSystemUIMode() to manually set the ui overlays you want.

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();

  SystemChrome.setEnabledSystemUIMode(
    SystemUiMode.manual,
    overlays: [SystemUiOverlay.top],
  );

  runApp(AppWidget());
}

Or set overlays: [], for fullscreen

Documentation: https://api.flutter.dev/flutter/services/SystemChrome/setEnabledSystemUIMode.html

  •  Tags:  
  • Related