Solved: How to change status bar color in Flutter?

Question

Asked by Mohamed H on September 25, 2018 (source).

I am trying to change the status bar color to white. I found this pub on flutter. I tried to use the example code on my dart files.

Answer

Question answered by Andrey T (source).

Works totally fine in my app

import 'package:flutter_statusbarcolor/flutter_statusbarcolor.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    FlutterStatusbarcolor.setStatusBarColor(Colors.white);
    return MaterialApp(
      title: app_title,
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: HomePage(title: home_title),
    );
  }
}

(this package)

UPD: Another solution

SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
  statusBarColor: Colors.white
));
DART FLUTTER FLUTTER-DEPENDENCIES FLUTTER-LAYOUT
SHARE: