joostlek / GradientAppBar

Gradient app bar for Flutter
https://pub.dartlang.org/packages/gradient_app_bar
BSD 3-Clause "New" or "Revised" License
134 stars 68 forks source link

StatusBar #6

Open brunohenriquy opened 5 years ago

brunohenriquy commented 5 years ago

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

joostlek commented 5 years ago

Could you maybe provide a screenshot?

brunohenriquy commented 4 years ago

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.

joostlek commented 4 years ago

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

brunohenriquy commented 4 years ago

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

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

image

joostlek commented 4 years ago

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

brunohenriquy commented 4 years ago

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.

joostlek commented 4 years ago

Hmmmmm, interesting

omishah commented 4 years ago

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 
    ));
  }