Home > OS >  The argument type 'Brightness' can't be assigned to the parameter type 'Color?&#
The argument type 'Brightness' can't be assigned to the parameter type 'Color?&#

Time:07-21

I try to change to color of the statusBarColor to dark but it says error

SystemChrome.setSystemUIOverlayStyle(
      SystemUiOverlayStyle(statusBarColor: Brightness.dark));

CodePudding user response:

It should be Colors.black instead of Brightness.

Or if you want to keep the background color use a semi-transparent color like Colors.black45 or change manually with Colors.black.withOpacity(0.5)

CodePudding user response:

Try This

statusBarColor: Colors.red,

statusBarIconBrightness: Brightness.dark, // For Android (dark icons)

statusBarBrightness: Brightness.light, // For iOS (dark icons)

  • Related