skip to Main Content

The app has a black problem at the top and bottom of the screen, how can I solve this problem?enter image description here

I tried this codes
 SystemChrome.setSystemUIOverlayStyle(
      const SystemUiOverlayStyle(statusBarColor: Colors.transparent)); 
This code didn't work

3

Answers


  1. await SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
    
    Login or Signup to reply.
  2. I suggest to provide code for better understanding of problem.

    Looks like container or image is fit to width and centered.

    try to fit image

    Image.network(
      'image.jpg',
       fit: BoxFit.cover, // or fit: BoxFit.fitHeight,
    )
    

    or if its container, use ‘expanded’ to fill container to screen

    Expanded(
     child: Container(
       color: Colors.red,
     ),
    ),
    
    Login or Signup to reply.
  3. you can check this issue page
    https://github.com/flutter/flutter/issues/65632#issuecomment-714535817

    in this issue page said, this method needs future delay,
    please try under these codes.

    Future.delayed(Duration(milliseconds: 1)).then(
    (value) => SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
          systemNavigationBarColor: backgroundColor,
          systemNavigationBarDividerColor: backgroundColor,
          systemNavigationBarIconBrightness: Brightness.light,
          statusBarColor: backgroundColor,
          statusBarBrightness: Brightness.light,
          statusBarIconBrightness: Brightness.light,
        )));
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search