flutter code color code example

Example 1: color of status bar flutter

SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
  statusBarColor: Colors.white
));

Example 2: color() in flutter

// Color() widget can be used in the following way:
//where 123456 is the hex color code without the '#'


Color myHexColor = Color(0xff123456)

Example 3: flutter status bar color

return AnnotatedRegion<SystemUiOverlayStyle>(
  value: const SystemUiOverlayStyle(
    // For Android.
    // Use [light] for white status bar and [dark] for black status bar.
    statusBarIconBrightness: Brightness.light,
    // For iOS.
    // Use [dark] for white status bar and [light] for black status bar.
    statusBarBrightness: Brightness.dark,
  ),
  child: Scaffold(...),
);

Tags:

Misc Example