# fluttertpc_flutter_statusbarcolor_ns **Repository Path**: openharmony-sig/fluttertpc_flutter_statusbarcolor_ns ## Basic Information - **Project Name**: fluttertpc_flutter_statusbarcolor_ns - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 5 - **Created**: 2024-11-11 - **Last Updated**: 2025-05-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 🚨 **重要提示 | IMPORTANT** > > **⚠️ 此代码仓已归档。新地址请访问 [fluttertpc_flutter_statusbarcolor_ns](https://gitcode.com/openharmony-sig/fluttertpc_flutter_statusbarcolor_ns)。| ⚠️ This repository has been archived. For the new address, please visit [fluttertpc_flutter_statusbarcolor_ns](https://gitcode.com/openharmony-sig/fluttertpc_flutter_statusbarcolor_ns).** > --- > # flutter_statusbarcolor_ns [![pub package](https://img.shields.io/pub/v/flutter_statusbarcolor_ns?style=for-the-badge)](https://pub.dev/packages/flutter_statusbarcolor) The package now supports to android v2 embedding, thanks to [vixez](https://github.com/Sameerkash/flutter_statusbarcolor/pull/1) A package can help you to change your flutter app's statusbar's color or navigationbar's color programmatically. This is a fork of the original package `flutter_statusbarcolor` migrated to support null-safety. ## Getting Started ```dart // 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](https://user-images.githubusercontent.com/7392658/46727295-d5528480-ccb2-11e8-9bbf-e47e40ee36c3.png) Details in [example/](https://github.com/mchome/flutter_statusbarcolor/tree/master/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](https://docs.flutter.io/flutter/widgets/WidgetsBindingObserver-class.html) mixin. - If iOS build does not work, please send issues or pull requests.