Flutter StatusBar Manager for iOS & Android

Overview

flutter_statusbar_manager

Now compatible with AndroidX thanks to https://github.com/lorenzOliveto

Flutter Statusbar Manager, lets you control the status bar color, style (theme), visibility, and translucent properties across iOS and Android. With some added bonus for Android to control the Navigation Bar.

This plugin is based on React Native's StatusBar component.

The Navigation Bar code was taken from the awesome flutter-screen-theme-plugin.

Demo App Android Status Bar

Demo App Android Status Bar hide

Demo App Android Nav Bar

Demo App Iphone 8

Demo App Iphone X

Installation

flutter_statusbar_manager : ^lastest_version

to your pubspec.yaml ,and run

flutter packages get

in your project's root directory.

Basic Usage

Create a new project with command

flutter create myapp

On iOS add the following in your Info.plist:

<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>

Import the plugin in lib/main.dart like this:

import 'package:flutter_statusbar_manager/flutter_statusbar_manager.dart';

Methods

setColor

Platforms: Android

The setColor method will set the status bar background color. On iOS the method will always return a successful Future.

Parameter Type Default Required Description
color Color none Yes The color to be set as background, can use colors with opacity.
animated bool false No Whether or not to animate the color change.
await FlutterStatusbarManager.setColor(Colors.green, animated:true);

setTranslucent

Platforms: Android

The setTranslucent method will set the status bar translucent status. On iOS the methods will always return a successful Future.

Parameter Type Default Required Description
translucent bool none Yes Whether or not the status bar will be translucent.
await FlutterStatusbarManager.setTranslucent(true);

setHidden

Platforms: Android, iOS

The setHidden will hide the status bar.

Parameter Type Default Required Description
hidden bool none Yes Whether or not to hide the status bar.
animation StatusBarAnimation StatusBarAnimation.NONE No The hiding animation to use (iOS only).
await FlutterStatusbarManager.setHidden(true, animation:StatusBarAnimation.SLIDE);

setStyle

Platforms: Android, iOS

The setStyle method will set the status bar theme.

Parameter Type Default Required Description
style StatusBarStyle none Yes The status bar theme to use for styling, can either be light, dark, default.
await FlutterStatusbarManager.setStyle(StatusBarStyle.DARK_CONTENT);

setNetworkActivityIndicatorVisible

Platforms: iOS

The setNetworkActivityIndicatorVisible method will show or hide the activity indicator, On Android the method will always return a successful Future.

Parameter Type Default Required Description
visible bool none Yes Whether or not to show the activity indicator.
await FlutterStatusbarManager.setNetworkActivityIndicatorVisible(true);

getHeight

Platforms: Android, iOS

The getHeight getter method will return the height of the status bar.

double height = await FlutterStatusbarManager.getHeight

Bonus Methods

setNavigationBarColor

Platforms: Android

The setNavigationBarColor method will set the navigation bar background color. On iOS the method will always return a successful Future.

Parameter Type Default Required Description
color Color none Yes The color to be set as background.
animated bool false No Whether or not to animate the color change.
await FlutterStatusbarManager.setNavigationBarColor(Colors.green, animated:true);

setNavigationBarStyle

Platforms: Android

The setNavigationBarStyle method will set the navigation bar theme.

Parameter Type Default Required Description
style NavigationBarStyle none Yes The navigation bar theme to use for styling, can either be light, dark, default.
await FlutterStatusbarManager.setNavigationBarStyle(NavigationBarStyle.DARK);

setFullscreen

Platforms: Android, iOS

The setFullscreen method will set the app in fullscreen mode.

Parameter Type Default Required Description
fullscreen bool none Yes Whether or not to set the app on fullscreen mode.
await FlutterStatusbarManager.setNavigationBarStyle(NavigationBarStyle.DARK);

Enums

StatusBarStyle

  • StatusBarStyle.DEFAULT
  • StatusBarStyle.LIGHT_CONTENT
  • StatusBarStyle.DARK_CONTENT

StatusBarAnimation

  • StatusBarAnimation.NONE
  • StatusBarAnimation.FADE
  • StatusBarAnimation.SLIDE

NavigationBarStyle

  • NavigationBarStyle.DEFAULT
  • NavigationBarStyle.DARK
  • NavigationBarStyle.LIGHT

Status bar

Compatibility: Android (6.0+) & iOS

On Android, it will only work with Android 6.0 (Marshmallow) and above devices.

Navigation bar

Compatibility: Android only

Android 5.0 (Lollipop) and above: color

Android 8.0 (Oreo) and above: style (dark/light)

Comments
  • Error with version 1.0.1

    Error with version 1.0.1

    I receive the following error when trying to run on Android: error: package tandroid.animation does not exist import tandroid.animation.ArgbEvaluator;

    • What went wrong: Execution failed for task ':flutter_statusbar_manager:compileDebugJavaWithJavac'.

    Compilation failed; see the compiler error output for details.

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

    • Get more help at https://help.gradle.org

    BUILD FAILED in 2s Finished with error: Gradle build failed: 1

    opened by rlee1990 4
  • error: package android.support.v4.view does not exist

    error: package android.support.v4.view does not exist

    This issue seems to occur only on AndroidX. I've migrated my code to AndroidX. This can be resolved by importing import androidx.core.view.ViewCompat in your main java file. I'm no android dev so I don't know how to exactly resolve this but if possible please implement a method which import correct things for the correct platform.

    opened by DebkanchanSamadder 2
  • Support null-safety

    Support null-safety

    Hi @mendieta and @lorenzOliveto ! I made a couple of small changes to support null-safety. Please review this PR so that apps using this package could have sound null-safety support. Thanks!

    opened by amitkot 1
  • Some feature not working on android in release mode

    Some feature not working on android in release mode

    When I debug the flutter app, everything is ok. But when I run in release mode flutter run --release -d xxxxxx, below feature is not work for me:

    FlutterStatusbarManager.setStyle(StatusBarStyle.DARK_CONTENT);
    FlutterStatusbarManager.setNavigationBarStyle(NavigationBarStyle.DARK);
    

    Call the manager just in app build: image


    env:

    • device: Google Pixel 2 XL running Android 9
    • flutter doctor ouput:
    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel stable, v1.2.1, on Mac OS X 10.14.3 18D109, locale zh-Hans-CN)
    [✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    [✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
    [✓] Android Studio (version 3.3)
    [✓] VS Code (version 1.32.3)
    [!] Proxy Configuration
        ! NO_PROXY is not set
    [!] Connected device
        ! No devices available
    
    opened by jkyeo 1
  • Can gradle plugin be upgraded?

    Can gradle plugin be upgraded?

    When I change build.gradle to use classpath 'com.android.tools.build:gradle:3.3.0' I experience this error when running flutter run:

    The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.0 and higher.
    The following dependencies do not satisfy the required version:
    project ':flutter_statusbarcolor' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71
    

    and probably need to downgrade to 3.2.1 as per https://stackoverflow.com/questions/54693595/flutter-the-android-gradle-plugin-supports-only-kotlin-gradle-plugin-version-1

    Is it possible to upgrade?

    opened by psyanite 1
  • StatusBarStyle does not change

    StatusBarStyle does not change

    I'm using Google Pixel 3 (with Android P), and the following code didn't change my status bar theme.

    //~ inside of State<MyApp>/initState method
    FlutterStatusbarManager.setStyle(StatusBarStyle.DARK_CONTENT);
    

    I've tried StatusBarStyle.DARK_CONTENT and also StatusBarStyle.LIGHT_CONTENT and both of them showed white status bar icons.

    thanks.

    opened by JUSTIVE 1
  • Still maintained?

    Still maintained?

    As this lib doesn't seem to be maintained anymore, I created a fork which I will update from time to time: github.com/rafaelmaeuer/flutter_statusbar_manager

    I want to continue using this dependency in some projects, so I am thinking about re-publishing it on pub.dev as statusbar_manager package... any thoughts?

    opened by rafaelmaeuer 2
  • Deprecated version of the Android embedding

    Deprecated version of the Android embedding

    The plugins `flutter_statusbar_manager` use a deprecated version of the Android embedding.
    To avoid unexpected runtime failures, or future build failures, try to see if these plugins support the Android V2 embedding. Otherwise, consider removing them since a future release of Flutter will remove these deprecated APIs.
    If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.
    
    opened by efraespada 6
  • migrate to null-safety

    migrate to null-safety

    Hi guys, I migrated package to null safety, to be honest I think this library is no more maintainable so you can use null safety version directly from git.

    flutter_statusbar_manager:
      git:
        url: https://github.com/NarHakobyan/flutter_statusbar_manager
        ref: master
    
    opened by NarHakobyan 5
Owner
Foo()
Foo()
Utility Manager Flutter Application is made with Flutter and Supabase which allows user to add task, set remainder to the task, set color to separate tasks and it allows to add URL with URL's informations.

Utility Manager Flutter Application! Utility Manager Flutter Application is made with Flutter and Supabase which allows user to add task, set remainde

Kathirvel Chandrasekaran 6 Jan 6, 2022
AuthPass - Password Manager based on Flutter for all platforms. Keepass 2.x (kdbx 3.x) compatible.

AuthPass.app - Open Source Password Manager for mobile and desktop AuthPass - Password Manager based on Flutter for all platforms. Keepass 2.x (kdbx 3

AuthPass 1.5k Jan 5, 2023
A task manager built with Flutter, Serverless, Postgres, Firebase

Tasky Mobile App A project management mobile app This project is an implementation of a Design i found on uigaints.com by Ashish Dhakal. The Backend w

Etornam Sunu 137 Dec 31, 2022
A simple, cross-platform password manager created with Flutter.

PassMan PassMan Logo © 2021 by Yash Ahir is licensed under CC BY-NC 4.0 A simple, cross-platform password manager created with Flutter. How to run thi

Yash Ahir 19 Dec 14, 2022
Simple student record manager app for learning flutter basics

Simple Student Record Manager Simple student record manager app for learning flutter basics integrated with Django REST API (refer Generic-Student-API

Akshat Soni 3 Oct 31, 2022
Plant Manager is an application that was developed on Rocketseat NLW5 with React Native but was rebuilt using Flutter.

Technologies | Project | Layout | License ?? Technologies This project was developed with the following technologies: Flutter ?? Project Plant Manager

Mayderson 7 Aug 11, 2021
Flutter Theme Manager with Abstract Factory Design

extheme A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this

Veli Bacik 28 Dec 23, 2022
Password Manager Created Using Flutter And SQLite

Password Manager Created Using Flutter And SQLite

Imira Randeniya 15 Dec 24, 2022
Create mobile file manager design using Flutter

Mobile File Manager Watch it on YouTube Home & Cloud Screen On this file manager design has two pages. The Home page displays file usage information,

Firgia 38 Dec 23, 2022
Flutter network manager package.

Features With Network Manager, you can now easily manage your internet requests, send and receive data. Usage Set Base URL Settings Base URL -> Networ

Sercan KAYA 14 Dec 4, 2022
An open source task manager (todo list) app, developed using Dart language and Flutter framework.

Tasker An open source task manager (todo list) app, developed using Dart language and Flutter framework. Screenrecords     Screenshots                

Erfan Rahmati 42 Dec 29, 2022
Finance manager for devlance using flutter and firebase (Open source)

finance_manager A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

ANIKET SINDHU 2 Dec 27, 2021
Flutter Package Manager

Flutter Package Manager Flutter Package Manager, powerfull package management via CLI, add/search/top/favorite packages! Install > pub global activate

César Ferreira 3 Dec 1, 2021
CLI package manager and template for Flutter

Slidy CLI package manager and template generator for Flutter. Generate Modules, Pages, Widgets, BLoCs, Controllers, tests and more. Slidy supports mob

Flutterando 768 Dec 20, 2022
A task manager app made with flutter where you can mark your tasks for specific days and keep your life organized!

task_manager_app A task manager app made with flutter where you can mark your tasks for specific days and keep your life organized! Getting Started Th

null 2 Sep 1, 2021
One Password to Rule - A Flutter Deterministic password manager.

OPTR - One Password to Rule Flutter #Hack20 - Cyberpunk Concepta Team: Leo Farias and Ianko Leite Pitch Are you ready for password freedom? Create eas

Leo Farias 43 Nov 16, 2022
Audio manager - A flutter plugin for music playback, including notification handling.

audio_manager A flutter plugin for music playback, including notification handling. This plugin is developed for iOS based on AVPlayer, while android

Jerome Xiong 96 Oct 25, 2022
An opensource password manager

Passman An open source password manager Contents Description Project structure Project roadmap Getting started Built with Contributing Authors License

Developer Student Clubs KGEC 4 Aug 18, 2022