flutter_statusbarcolor_ns
0.6.0, released 2 years ago by sameerkashyap.me
Programmatically change status bar and navigation bar colors in Flutter apps.
What it does
This plugin allows developers to dynamically change or retrieve the color and foreground brightness (white or dark) of the device's status bar and navigation bar programmatically on Android and iOS.
AI-written summary of version 0.6.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to imperatively change the status bar or navigation bar color based on the current screen or theme.
- You need to control the foreground icon/text brightness of the status bar or navigation bar.
Skip it when
- You prefer using Flutter's built-in SystemChrome configurations for status bars (though this plugin allows fetching and more direct color modifications).
- You are targeting platforms other than Android and iOS.
Strengths
- Supports getting and setting both status bar and navigation bar colors.
- Provides helper functions like useWhiteForeground to determine contrast.
- Supports Android v2 embedding and null-safety.
Weaknesses
- Foreground brightness may sometimes revert after app lifecycle changes, requiring manual handling via WidgetsBindingObserver.
- Limited to Android and iOS platforms.
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
No extra permissions or configuration required beyond standard Flutter plugin integration.
await FlutterStatusbarcolor.setStatusBarColor(Colors.green[400]);
if (useWhiteForeground(Colors.green[400])) {
FlutterStatusbarcolor.setStatusBarWhiteForeground(true);
} else {
FlutterStatusbarcolor.setStatusBarWhiteForeground(false);
}Alternatives
Packages that do the same job and could replace flutter_statusbarcolor_ns.
- themed
Define themes with const values and change them dynamically at runtime.
79Compare - random_color_scheme
Generates random light and dark Material Design color schemes respecting WCAG guidelines.
57Compare - derived_colors
Generate color variants and modifications for Flutter applications.
50Compare - text_editor
An Instagram-like text editor widget for editing text style, size, color, and alignment.
45Compare
Works with
Packages commonly used together with flutter_statusbarcolor_ns: ones it builds on, ones built on it, and its own family.