I\'m trying to change the color of system status bar to black. The configuration seems to be overridden by the AppBar class. I can achieve what I want by assigning theme: to
I'm quite new to StackOverflow & I've never used Flutter however I have found this package that seems to make things relatively easy.
Method 1: Using the package
Once this is imported all you need to do is add this code fragment:
try {
await FlutterStatusbarcolor.setStatusBarColor(Colors.black);
} on PlatformException catch (e) {
print(e);
}
Replacing the parameter for the setStatusBarColor()
should give you the desired result, a full list of colours can be found here.
Method 2: Using default functions
If this doesn't work / you don't want to add extra packages or libraries then perhaps this StackOverflow answer may help.
It involves using a similar function to the above method: getWindow().setStatusBarColor()
or getActivity().getWindow().setStatusBarColor()
Replacing the parameter with the desired hex code from the same list as earlier may also result in a solution.
Hope it works/helps!