GradientAppBar icon indicating copy to clipboard operation
GradientAppBar copied to clipboard

StatusBar

Open brunohenriquy opened this issue 6 years ago • 8 comments

Is there any way to remove this darkness in the Android Status Bar?

brunohenriquy avatar May 06 '19 16:05 brunohenriquy

Could you maybe provide a screenshot?

joostlek avatar Jul 15 '19 07:07 joostlek

Could you maybe provide a screenshot?

image

I know It's an Android Pattern. But I was wondering if there is a way of hacking it, to become the same as on iOS.

brunohenriquy avatar Sep 21 '19 15:09 brunohenriquy

Could you maybe try this? It should work with the gradient app bar. https://stackoverflow.com/questions/49015038/removing-the-drop-shadow-from-a-scaffold-appbar-in-flutter

joostlek avatar Sep 22 '19 10:09 joostlek

Could you maybe try this? It should work with the gradient app bar. https://stackoverflow.com/questions/49015038/removing-the-drop-shadow-from-a-scaffold-appbar-in-flutter

The elevation adds a shadow between the AppBar and the Page Content:

image

  • With elevation: image

  • Without elevation: image

I am talking about the difference in colors 1 and 2 on Android:

image

brunohenriquy avatar Sep 22 '19 14:09 brunohenriquy

Oh well, in the screenshot it looked like it dissapeard. Maybe a little hacky, but it would work, setting the status bar the same color as your primary color in your themedata. https://stackoverflow.com/questions/52489458/how-to-change-status-bar-color-in-flutter

joostlek avatar Sep 22 '19 14:09 joostlek

Oh well, in the screenshot it looked like it dissapeard. Maybe a little hacky, but it would work, setting the status bar the same color as your primary color in your themedata. https://stackoverflow.com/questions/52489458/how-to-change-status-bar-color-in-flutter

That's because that's an iOS simulator, on iOS it gets the same Color.

Even setting the same color on themedata, it will show darker on Android, that's where I would like to find maybe a deep hack to override it.

brunohenriquy avatar Sep 22 '19 23:09 brunohenriquy

Hmmmmm, interesting

joostlek avatar Sep 23 '19 08:09 joostlek

Add this code in your main.dart or in the class file where you have declared your MaterialApp() to hide the black shadow or elevation shown on the status bar in Android:

 @override
  void initState() {
    super.initState();

    // set the status bar to transparent on android, to remove the black shadows
    SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values);
    SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
      statusBarColor: Colors.transparent, // transparent or any color of your choice
      statusBarIconBrightness: Brightness.dark, // Brightness.dark = White icons and text color for status bar ; Brightness.light for dark icons and text color 
    ));
  }

omishah avatar Dec 06 '19 09:12 omishah