I just started using flutter and android studio and I was wondering if there’s a way to make a transparent status bar like the pic on Android (no transition from the status bar to the appBar). When I try to set the status bar color, it gets a different shade than the appBar. Thanks
To make the Status Bar background color transparent, Insert it into the widget builder. SystemChrome. setSystemUIOverlayStyle( SystemUiOverlayStyle( statusBarColor: Colors. transparent, //color set to transperent or set your own color statusBarIconBrightness: Brightness.
Step 1: Locate the MaterialApp widget. Step 2: Inside the MaterialApp, add the theme parameter with ThemeData class assigned. Step 3: Inside the ThemeData add the appBarTheme parameter and then assign the AppBarTheme class. Step 4: Inside the AppBarTheme , specify the systemOverlayStyle parameter and set the color.
You can use the AnnotatedRegion
widget with SystemUiOverlayStyle
to change the chrome styles.
import 'package:flutter/services.dart'; class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return AnnotatedRegion<SystemUiOverlayStyle>( value: SystemUiOverlayStyle( statusBarColor: Colors.transparent, ), child: Scaffold(...), ); } }
You can read more about what's possible with SystemUiOverlayStyle here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With