5

By running this code, I have 2 different outcomes for Android and iOs. For Android everything works as expected, but for the iOs it's ignored. I don't get any errors or such.

class MyMaterialApp extends StatefulWidget {
  const MyMaterialApp({Key key}) : super(key: key);

  @override
  _MyMaterialAppState createState() => _MyMaterialAppState();
}

class _MyMaterialAppState extends State<MyMaterialApp> {
  @override
  Widget build(BuildContext context) {
    SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
      statusBarColor: Colors.blue,
      statusBarIconBrightness: Brightness.dark,
      systemNavigationBarColor: Colors.blue,
      systemNavigationBarIconBrightness: Brightness.dark,
    ));
    return MaterialApp()
}
}

iPhone 11 emulator: iPhone 11 emulator

Samsung s10e device: Samsung s10e device

Does anyone have any idea why this is happening? Thanks!

kmtz
  • 484
  • 4
  • 14
  • Have you tried to set color copying the style to avoid null values? https://stackoverflow.com/questions/51012360/flutter-system-navigation-bar-and-status-bar-color/51013116#51013116 – E.Benedos Sep 25 '20 at 12:24
  • I have tried with copying the value but the result is the same. Android is working, iOs not. – kmtz Sep 28 '20 at 09:33
  • @kmtz Have you got the solution? I'm facing the same issue. – Alpit Panchal May 10 '22 at 13:26
  • Yes I did but used completely other approach. What you can do is to wrap your Scaffold with SafeArea widget and SafeArea with Container and set some color. For example Container(color: Colors.blue, child: SafeArea(top: false, child: Scaffold(....))); which will paint blue your bottom part of the screen. @AlpitPanchal – kmtz May 10 '22 at 15:06
  • @kmtz thanks for responde, but I have never used the safeArea widget, so in this case how can I fix this issue. – Alpit Panchal May 11 '22 at 10:33

0 Answers0