Reputation: 153
When using Gestures for Navigation, how can I change the background color of the area beneath bottom Navigation.
Upvotes: 5
Views: 2455
Reputation: 153
Okay, so after a lot of fiddling, I have arrived at this answer.
We need to wrap the material app/scaffold with AnnotatedRegion
.
So I have changed my main.dart in the following way:
AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle(
statusBarColor: Colors.transparent, //top status bar
systemNavigationBarColor: Colors.black, // navigation bar color, the one Im looking for
statusBarIconBrightness: Brightness.dark, // status bar icons' color
systemNavigationBarIconBrightness:
Brightness.dark, //navigation bar icons' color
),
child: MaterialApp(
debugShowCheckedModeBanner: false,
And this worked smoothly with a rebuild.
Hope this helps! :)
Upvotes: 8
Reputation: 1342
You can use flutter_statusbarcolor_ns package to achieve your requirements.
The above package can help you to change your flutter app's statusbar's color or navigationbar's color programmatically.
Upvotes: 0
Reputation: 326
You need to wrap your widgets with Safe Area
widget. After you need to set bottom
property false
Upvotes: -1