flutter_statusbarcolor 0.2.0

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 97

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]
await FlutterStatusbarcolor.setStatusBarColor(Colors.green[400]);
if (useWhiteForeground(Colors.green[400])) {
  FlutterStatusbarcolor.setStatusBarWhiteForeground(true);
} else {
  FlutterStatusbarcolor.setStatusBarWhiteForeground(false);
}

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

// get statusbar color and navigationbar color
Color statusbarColor = await FlutterStatusbarcolor.getStatusBarColor();
Color navigationbarColor = await FlutterStatusbarcolor.getNavigationBarColor();

preview

Details in example/ folder.

Api level minimum requirement #

  • android

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

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

Note that #

  • If you find the foreground brightness reverted after changing the app lifecycle, please use flutter's WidgetsBindingObserver mixin.
  • If ios build does not work, please send issues or pull requests.

Changelog #

[0.2.0]

  • Breaking change. Updated Gradle tooling, kotlin version and compileSdkVersion. Same as 0.1.5.

[0.1.6]

  • Reverse to 0.1.4+1.

[0.1.5]

  • Android dependencies version upgrade for AndroidX support.

[0.1.4+1]

  • Update docs.

[0.1.4]

  • Allow to animate the color after setting the color of statusbar or navigationbar.

[0.1.3]

  • Fix ios build.

[0.1.2]

  • Add getStatusBarColor and getNavigationBarColor.

[0.1.1]

  • Fix ios build.

[0.1.0]

  • Add setStatusBarWhiteForeground to set statusbar content color.
  • Add setNavigationBarWhiteForeground to set navigationbar content color.
  • Add useWhiteForeground to know the background is fit with white content.

[0.0.4]

  • Upgrade to dart2.

[0.0.3]

  • Try to fix ios build again.

[0.0.2]

  • Try to fix ios build.

[0.0.1+1]

  • Format code.

[0.0.1]

  • Initial release.

example/README.md

flutter_statusbarcolor_example #

Demonstrates how to use the flutter_statusbarcolor plugin.

Getting Started #

For help getting started with Flutter, view our online documentation.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_statusbarcolor: ^0.2.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_statusbarcolor/flutter_statusbarcolor.dart';
  
Version Uploaded Documentation Archive
0.2.0 Feb 13, 2019 Go to the documentation of flutter_statusbarcolor 0.2.0 Download flutter_statusbarcolor 0.2.0 archive
0.1.6 Feb 13, 2019 Go to the documentation of flutter_statusbarcolor 0.1.6 Download flutter_statusbarcolor 0.1.6 archive
0.1.5 Feb 11, 2019 Go to the documentation of flutter_statusbarcolor 0.1.5 Download flutter_statusbarcolor 0.1.5 archive
0.1.4+1 Jan 14, 2019 Go to the documentation of flutter_statusbarcolor 0.1.4+1 Download flutter_statusbarcolor 0.1.4+1 archive
0.1.4 Jan 3, 2019 Go to the documentation of flutter_statusbarcolor 0.1.4 Download flutter_statusbarcolor 0.1.4 archive
0.1.3 Dec 16, 2018 Go to the documentation of flutter_statusbarcolor 0.1.3 Download flutter_statusbarcolor 0.1.3 archive
0.1.2 Dec 14, 2018 Go to the documentation of flutter_statusbarcolor 0.1.2 Download flutter_statusbarcolor 0.1.2 archive
0.1.1 Oct 13, 2018 Go to the documentation of flutter_statusbarcolor 0.1.1 Download flutter_statusbarcolor 0.1.1 archive
0.1.0 Oct 10, 2018 Go to the documentation of flutter_statusbarcolor 0.1.0 Download flutter_statusbarcolor 0.1.0 archive
0.0.4 Aug 9, 2018 Go to the documentation of flutter_statusbarcolor 0.0.4 Download flutter_statusbarcolor 0.0.4 archive

All 14 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
96
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
95
Overall:
Weighted score of the above. [more]
97
Learn more about scoring.

We analyzed this package on Jun 17, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.2
  • pana: 0.12.18
  • Flutter: 1.5.4-hotfix.2

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Maintenance issues and suggestions

Support latest dependencies. (-5 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.28.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8