Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

how to apply color to statusbar in flutter?

i want to change statusbar color to white. but it loos like gray.
i use safeArea, and not use appbar. so i wrap safearea in Container to set color to white.

@override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.white, // statusbar color
      child: SafeArea(
          child: Scaffold(
        backgroundColor: Theme.of(context).scaffoldBackgroundColor,
        body: Column(
          children: [
            appBarContainer(),
            Expanded(
              child: GetX<PostDetailController>(
                builder: (controller) {
                  return Scrollbar(
                      child: ListView.builder(
                    itemBuilder: (context, index) {
                      return postContainer(context, controller);
                    },
                    itemCount: controller.post.length,
                  ));
                },
              ),
            )
          ],
        ),
      )),
    );
  }
}

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

refer below code and add this in void main() before runApp

SystemChrome.setSystemUIOverlayStyle(
  const SystemUiOverlayStyle(
    statusBarColor: Colors.transparent,      // status bar color
  ),
);
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading