flutter_statusbarcolor 0.1.0 copy "flutter_statusbarcolor: ^0.1.0" to clipboard
flutter_statusbarcolor: ^0.1.0 copied to clipboard

discontinued
outdated

A package can help you to change your flutter app's statusbar's color or navigationbar's color programmatically.

flutter_statusbarcolor #

pub package

A package can help you to change your flutter app's statusbar's color or navigationbar's color programmatically.

Getting Started #

Installation #

Add this to your pubspec.yaml (or create it):

dependencies:
  flutter_statusbarcolor: any

Then run the flutter tooling:

flutter packages get

Example #

// change the status bar color to material color [green-400].
try {
  await FlutterStatusbarcolor.setStatusBarColor(Colors.green[400]);
  if (useWhiteForeground(Colors.green[400])) {
    FlutterStatusbarcolor.setStatusBarWhiteForeground(true);
    FlutterStatusbarcolor.setNavigationBarWhiteForeground(true);
  } else {
    FlutterStatusbarcolor.setStatusBarWhiteForeground(false);
    FlutterStatusbarcolor.setNavigationBarWhiteForeground(false);
  }
} on PlatformException catch (e) {
  print(e);
}

// change the navigation bar color to material color [orange-200].
try {
  await FlutterStatusbarcolor.setNavigationBarColor(Colors.orange[200]);
  if (useWhiteForeground(Colors.orange[200]) {
    FlutterStatusbarcolor.setStatusBarWhiteForeground(true);
    FlutterStatusbarcolor.setNavigationBarWhiteForeground(true);
  } else {
    FlutterStatusbarcolor.setStatusBarWhiteForeground(false);
    FlutterStatusbarcolor.setNavigationBarWhiteForeground(false);
  }
} on PlatformException catch (e) {
  print(e);
}

preview

Details in example/ folder.

Api level minimum requirement #

  • android

    • setStatusBarColor (5.0)
    • setStatusBarWhiteForeground (6.0)
    • setNavigationBarColor (5.0)
    • setNavigationBarWhiteForeground (8.0)
  • ios

    • setStatusBarColor (7+)
    • setStatusBarWhiteForeground (7+)

Note that #

  • If ios build does not work, please send issues or pull requests.
190
likes
0
pub points
92%
popularity

Publisher

unverified uploader

A package can help you to change your flutter app's statusbar's color or navigationbar's color programmatically.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_statusbarcolor