How to set status bar color when AppBar not present.
I have tried this but not working.
Widget build(BuildContext context) {
SystemChrome.setSys
If you take a look at the source code of AppBar, you can see they use an AnnotatedRegion widget. AnnotedRegion widget gives you more control on System overlay style. This is a more fluttery way to configure the system styles when an app bar is not used.
From my understanding, this widget automatically sets the statusbar/navigationbar color when the widget wrapped in it gets overlaid by the statusbar/navigationbar.
You can wrap your widget like this:
import 'package:flutter/services.dart';
...
Widget build(BuildContext context) {
return Scaffold(
body: AnnotatedRegion(
value: SystemUiOverlayStyle.light,
child: ...,
),
);
}
For more information about AnnotatedRegion widget head over to the API Docs