├── ios ├── Assets │ └── .gitkeep ├── Classes │ ├── FlutterStatusbarcolorPlugin.h │ └── FlutterStatusbarcolorPlugin.m ├── .gitignore └── flutter_statusbarcolor.podspec ├── android ├── gradle.properties ├── settings.gradle ├── .gitignore ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ └── kotlin │ │ └── com │ │ └── fuyumi │ │ └── flutterstatusbarcolor │ │ └── flutterstatusbarcolor │ │ └── FlutterStatusbarcolorPlugin.kt └── build.gradle ├── example ├── android │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── app │ │ ├── src │ │ │ └── main │ │ │ │ ├── res │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── values │ │ │ │ │ └── styles.xml │ │ │ │ └── drawable │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── fuyumi │ │ │ │ │ └── flutterstatusbarcolor │ │ │ │ │ └── flutterstatusbarcolorexample │ │ │ │ │ └── MainActivity.kt │ │ │ │ └── AndroidManifest.xml │ │ └── build.gradle │ ├── .gitignore │ ├── settings.gradle │ ├── build.gradle │ ├── gradlew.bat │ └── gradlew ├── ios │ ├── Flutter │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── AppFrameworkInfo.plist │ ├── Runner │ │ ├── AppDelegate.h │ │ ├── Assets.xcassets │ │ │ ├── LaunchImage.imageset │ │ │ │ ├── LaunchImage.png │ │ │ │ ├── LaunchImage@2x.png │ │ │ │ ├── LaunchImage@3x.png │ │ │ │ ├── README.md │ │ │ │ └── Contents.json │ │ │ └── AppIcon.appiconset │ │ │ │ ├── Icon-App-20x20@1x.png │ │ │ │ ├── Icon-App-20x20@2x.png │ │ │ │ ├── Icon-App-20x20@3x.png │ │ │ │ ├── Icon-App-29x29@1x.png │ │ │ │ ├── Icon-App-29x29@2x.png │ │ │ │ ├── Icon-App-29x29@3x.png │ │ │ │ ├── Icon-App-40x40@1x.png │ │ │ │ ├── Icon-App-40x40@2x.png │ │ │ │ ├── Icon-App-40x40@3x.png │ │ │ │ ├── Icon-App-60x60@2x.png │ │ │ │ ├── Icon-App-60x60@3x.png │ │ │ │ ├── Icon-App-76x76@1x.png │ │ │ │ ├── Icon-App-76x76@2x.png │ │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ │ └── Contents.json │ │ ├── main.m │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ ├── Main.storyboard │ │ │ └── LaunchScreen.storyboard │ │ └── Info.plist │ ├── Runner.xcodeproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── xcschemes │ │ │ │ └── Runner.xcscheme │ │ └── project.pbxproj │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── .gitignore │ └── Podfile ├── .gitignore ├── README.md ├── pubspec.yaml ├── .metadata ├── android.iml ├── flutter_statusbarcolor_example.iml ├── flutter_statusbarcolor_example_android.iml └── lib │ └── main.dart ├── .github └── FUNDING.yml ├── .gitignore ├── pubspec.yaml ├── LICENSE ├── CHANGELOG.md ├── flutter_statusbarcolor_android.iml ├── README.md ├── lib └── flutter_statusbarcolor.dart └── flutter_statusbarcolor.iml /ios/Assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'flutter_statusbarcolor' 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | custom: https://www.paypal.me/mchome19 4 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Classes/FlutterStatusbarcolorPlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface FlutterStatusbarcolorPlugin : NSObject 4 | @end 5 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchome/flutter_statusbarcolor/HEAD/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .atom/ 3 | .idea 4 | .packages 5 | .pub/ 6 | build/ 7 | ios/.generated/ 8 | packages 9 | pubspec.lock 10 | flutter_export_environment.sh 11 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchome/flutter_statusbarcolor/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchome/flutter_statusbarcolor/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchome/flutter_statusbarcolor/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchome/flutter_statusbarcolor/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchome/flutter_statusbarcolor/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchome/flutter_statusbarcolor/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | *.class 3 | .gradle 4 | /local.properties 5 | /.idea/workspace.xml 6 | /.idea/libraries 7 | .DS_Store 8 | /build 9 | /captures 10 | GeneratedPluginRegistrant.java 11 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchome/flutter_statusbarcolor/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchome/flutter_statusbarcolor/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchome/flutter_statusbarcolor/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchome/flutter_statusbarcolor/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchome/flutter_statusbarcolor/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchome/flutter_statusbarcolor/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchome/flutter_statusbarcolor/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchome/flutter_statusbarcolor/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchome/flutter_statusbarcolor/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchome/flutter_statusbarcolor/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchome/flutter_statusbarcolor/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchome/flutter_statusbarcolor/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchome/flutter_statusbarcolor/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchome/flutter_statusbarcolor/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchome/flutter_statusbarcolor/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchome/flutter_statusbarcolor/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchome/flutter_statusbarcolor/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .atom/ 3 | .idea 4 | .vscode/ 5 | .packages 6 | .pub/ 7 | build/ 8 | ios/.generated/ 9 | packages 10 | pubspec.lock 11 | .flutter-plugins 12 | ios/Podfile.lock 13 | ios/.symlinks/* 14 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # flutter_statusbarcolor_example 2 | 3 | Demonstrates how to use the flutter_statusbarcolor plugin. 4 | 5 | ## Getting Started 6 | 7 | For help getting started with Flutter, view our online 8 | [documentation](http://flutter.io/). 9 | -------------------------------------------------------------------------------- /example/ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char * argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_statusbarcolor_example 2 | description: Demonstrates how to use the flutter_statusbarcolor plugin. 3 | 4 | dependencies: 5 | flutter: 6 | sdk: flutter 7 | 8 | flutter_statusbarcolor: 9 | path: ../ 10 | 11 | flutter: 12 | uses-material-design: true 13 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 7 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: f802cf6d16b77d5453f459e90d3f03207833b81c 8 | channel: dev 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | 13 | *.pbxuser 14 | *.mode1v3 15 | *.mode2v3 16 | *.perspectivev3 17 | 18 | !default.pbxuser 19 | !default.mode1v3 20 | !default.mode2v3 21 | !default.perspectivev3 22 | 23 | xcuserdata 24 | 25 | *.moved-aside 26 | 27 | *.pyc 28 | *sync/ 29 | Icon? 30 | .tags* 31 | 32 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 7 | [GeneratedPluginRegistrant registerWithRegistry:self]; 8 | // Override point for customization after application launch. 9 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 10 | } 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/fuyumi/flutterstatusbarcolor/flutterstatusbarcolorexample/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.fuyumi.flutterstatusbarcolor.flutterstatusbarcolorexample 2 | 3 | import android.os.Bundle 4 | 5 | import io.flutter.app.FlutterActivity 6 | import io.flutter.plugins.GeneratedPluginRegistrant 7 | 8 | class MainActivity(): FlutterActivity() { 9 | override fun onCreate(savedInstanceState: Bundle?) { 10 | super.onCreate(savedInstanceState) 11 | GeneratedPluginRegistrant.registerWith(this) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_statusbarcolor 2 | description: A package can help you to change your flutter app's statusbar's color or navigationbar's color programmatically. 3 | version: 0.2.3 4 | author: "fuyumi " 5 | homepage: https://github.com/mchome/flutter_statusbarcolor 6 | 7 | dependencies: 8 | flutter: 9 | sdk: flutter 10 | 11 | flutter: 12 | plugin: 13 | androidPackage: com.fuyumi.flutterstatusbarcolor.flutterstatusbarcolor 14 | pluginClass: FlutterStatusbarcolorPlugin 15 | 16 | environment: 17 | sdk: ">=2.0.0-dev.28.0 <3.0.0" 18 | flutter: ">=0.1.4 <2.0.0" 19 | -------------------------------------------------------------------------------- /example/android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | *.pbxuser 16 | *.mode1v3 17 | *.mode2v3 18 | *.perspectivev3 19 | 20 | !default.pbxuser 21 | !default.mode1v3 22 | !default.mode2v3 23 | !default.perspectivev3 24 | 25 | xcuserdata 26 | 27 | *.moved-aside 28 | 29 | *.pyc 30 | *sync/ 31 | Icon? 32 | .tags* 33 | 34 | /Flutter/app.flx 35 | /Flutter/app.zip 36 | /Flutter/flutter_assets/ 37 | /Flutter/App.framework 38 | /Flutter/Flutter.framework 39 | /Flutter/Generated.xcconfig 40 | /ServiceDefinitions.json 41 | 42 | Pods/ 43 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.21' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.3.1' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /ios/flutter_statusbarcolor.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 3 | # 4 | Pod::Spec.new do |s| 5 | s.name = 'flutter_statusbarcolor' 6 | s.version = '0.0.1' 7 | s.summary = 'A new Flutter plugin.' 8 | s.description = <<-DESC 9 | A new Flutter plugin. 10 | DESC 11 | s.homepage = 'http://example.com' 12 | s.license = { :file => '../LICENSE' } 13 | s.author = { 'Your Company' => 'email@example.com' } 14 | s.source = { :path => '.' } 15 | s.source_files = 'Classes/**/*' 16 | s.public_header_files = 'Classes/**/*.h' 17 | s.dependency 'Flutter' 18 | 19 | s.ios.deployment_target = '8.0' 20 | end 21 | 22 | -------------------------------------------------------------------------------- /example/flutter_statusbarcolor_example.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | UIRequiredDeviceCapabilities 24 | 25 | arm64 26 | 27 | MinimumOSVersion 28 | 8.0 29 | 30 | 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 fuyumi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'com.fuyumi.flutterstatusbarcolor.flutterstatusbarcolor' 2 | version '1.0-SNAPSHOT' 3 | 4 | buildscript { 5 | ext.kotlin_version = '1.3.21' 6 | repositories { 7 | google() 8 | jcenter() 9 | } 10 | 11 | dependencies { 12 | classpath 'com.android.tools.build:gradle:3.3.1' 13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 14 | } 15 | } 16 | 17 | rootProject.allprojects { 18 | repositories { 19 | google() 20 | jcenter() 21 | } 22 | } 23 | 24 | apply plugin: 'com.android.library' 25 | apply plugin: 'kotlin-android' 26 | 27 | android { 28 | compileSdkVersion 28 29 | 30 | sourceSets { 31 | main.java.srcDirs += 'src/main/kotlin' 32 | } 33 | defaultConfig { 34 | minSdkVersion 16 35 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 36 | } 37 | lintOptions { 38 | disable 'InvalidPackage' 39 | } 40 | } 41 | 42 | dependencies { 43 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 44 | } 45 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## [0.2.3] 4 | 5 | * Fix iOS 13+ Dark mode. 6 | 7 | ## [0.2.2] 8 | 9 | * Fix iOS 13 build error. 10 | 11 | ## [0.2.1] 12 | 13 | * Null check for android activity. 14 | 15 | ## [0.2.0] 16 | 17 | * **Breaking change**. Updated Gradle tooling, kotlin version and compileSdkVersion. Same as `0.1.5`. 18 | 19 | ## [0.1.6] 20 | 21 | * Revert to `0.1.4`. 22 | 23 | ## [0.1.5] 24 | 25 | * Android dependencies version upgrade for AndroidX support. 26 | 27 | ## [0.1.4+1] 28 | 29 | * Update docs. 30 | 31 | ## [0.1.4] 32 | 33 | * Allow to animate the color after setting the color of statusbar or navigationbar. 34 | 35 | ## [0.1.3] 36 | 37 | * Fix ios build. 38 | 39 | ## [0.1.2] 40 | 41 | * Add `getStatusBarColor` and `getNavigationBarColor`. 42 | 43 | ## [0.1.1] 44 | 45 | * Fix ios build. 46 | 47 | ## [0.1.0] 48 | 49 | * Add `setStatusBarWhiteForeground` to set statusbar content color. 50 | * Add `setNavigationBarWhiteForeground` to set navigationbar content color. 51 | * Add `useWhiteForeground` to know the background is fit with white content. 52 | 53 | ## [0.0.4] 54 | 55 | * Upgrade to dart2. 56 | 57 | ## [0.0.3] 58 | 59 | * Try to fix ios build again. 60 | 61 | ## [0.0.2] 62 | 63 | * Try to fix ios build. 64 | 65 | ## [0.0.1+1] 66 | 67 | * Format code. 68 | 69 | ## [0.0.1] 70 | 71 | * Initial release. 72 | -------------------------------------------------------------------------------- /example/flutter_statusbarcolor_example_android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /flutter_statusbarcolor_android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | flutter_statusbarcolor_example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | arm64 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | UIViewControllerBasedStatusBarAppearance 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | apply plugin: 'com.android.application' 15 | apply plugin: 'kotlin-android' 16 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 17 | 18 | android { 19 | compileSdkVersion 28 20 | 21 | sourceSets { 22 | main.java.srcDirs += 'src/main/kotlin' 23 | } 24 | 25 | lintOptions { 26 | disable 'InvalidPackage' 27 | } 28 | 29 | defaultConfig { 30 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 31 | applicationId "com.fuyumi.flutterstatusbarcolor.flutterstatusbarcolorexample" 32 | minSdkVersion 16 33 | targetSdkVersion 28 34 | versionCode 1 35 | versionName "1.0" 36 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 37 | } 38 | 39 | buildTypes { 40 | release { 41 | // TODO: Add your own signing config for the release build. 42 | // Signing with the debug keys for now, so `flutter run --release` works. 43 | signingConfig signingConfigs.debug 44 | } 45 | } 46 | } 47 | 48 | flutter { 49 | source '../..' 50 | } 51 | 52 | dependencies { 53 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 54 | testImplementation 'junit:junit:4.12' 55 | androidTestImplementation 'com.android.support.test:runner:1.0.1' 56 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 57 | } 58 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # flutter_statusbarcolor 2 | 3 | [![pub package](https://img.shields.io/pub/v/flutter_statusbarcolor.svg)](https://pub.dev/packages/flutter_statusbarcolor) 4 | 5 | A package can help you to change your flutter app's statusbar's color or navigationbar's color programmatically. 6 | 7 | ## Getting Started 8 | 9 | ```dart 10 | // change the status bar color to material color [green-400] 11 | await FlutterStatusbarcolor.setStatusBarColor(Colors.green[400]); 12 | if (useWhiteForeground(Colors.green[400])) { 13 | FlutterStatusbarcolor.setStatusBarWhiteForeground(true); 14 | } else { 15 | FlutterStatusbarcolor.setStatusBarWhiteForeground(false); 16 | } 17 | 18 | // change the navigation bar color to material color [orange-200] 19 | await FlutterStatusbarcolor.setNavigationBarColor(Colors.orange[200]); 20 | if (useWhiteForeground(Colors.orange[200]) { 21 | FlutterStatusbarcolor.setNavigationBarWhiteForeground(true); 22 | } else { 23 | FlutterStatusbarcolor.setNavigationBarWhiteForeground(false); 24 | } 25 | 26 | // get statusbar color and navigationbar color 27 | Color statusbarColor = await FlutterStatusbarcolor.getStatusBarColor(); 28 | Color navigationbarColor = await FlutterStatusbarcolor.getNavigationBarColor(); 29 | ``` 30 | 31 | ![preview](https://user-images.githubusercontent.com/7392658/46727295-d5528480-ccb2-11e8-9bbf-e47e40ee36c3.png) 32 | 33 | Details in [example/](https://github.com/mchome/flutter_statusbarcolor/tree/master/example) folder. 34 | 35 | ## Api level minimum requirement 36 | 37 | - Android 38 | - getStatusBarColor (5.0) 39 | - setStatusBarColor (5.0) 40 | - setStatusBarWhiteForeground (6.0) 41 | - getNavigationBarColor (5.0) 42 | - setNavigationBarColor (5.0) 43 | - setNavigationBarWhiteForeground (8.0) 44 | 45 | - iOS 46 | - getStatusBarColor (7+) 47 | - setStatusBarColor (7+) 48 | - setStatusBarWhiteForeground (7+) 49 | 50 | ## Note that 51 | 52 | - If you find the foreground brightness reverted after changing the app lifecycle, 53 | please use flutter's [WidgetsBindingObserver](https://docs.flutter.io/flutter/widgets/WidgetsBindingObserver-class.html) mixin. 54 | - If iOS build does not work, please send issues or pull requests. 55 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 15 | 19 | 26 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /lib/flutter_statusbarcolor.dart: -------------------------------------------------------------------------------- 1 | /// Call platform code to get/set status bar or navigation bar 2 | /// background color and foreground brightness. 3 | 4 | import 'dart:async'; 5 | import 'dart:ui'; 6 | 7 | import 'package:flutter/services.dart'; 8 | 9 | class FlutterStatusbarcolor { 10 | static const MethodChannel _channel = 11 | const MethodChannel('plugins.fuyumi.com/statusbar'); 12 | 13 | /// Get the status bar background color. 14 | static Future getStatusBarColor() => 15 | _channel.invokeMethod('getstatusbarcolor').then((dynamic value) { 16 | return value == null ? null : Color(value); 17 | }); 18 | 19 | /// Set the status bar background color. 20 | static Future setStatusBarColor( 21 | Color color, { 22 | bool animate = false, 23 | }) => 24 | _channel.invokeMethod('setstatusbarcolor', { 25 | 'color': color.value, 26 | 'animate': animate, 27 | }); 28 | 29 | /// Set the status bar foreground brightness. 30 | /// Set to true, the color of the text and icon 31 | /// will be white, otherwise black. 32 | static Future setStatusBarWhiteForeground(bool useWhiteForeground) => 33 | _channel.invokeMethod('setstatusbarwhiteforeground', { 34 | 'whiteForeground': useWhiteForeground, 35 | }); 36 | 37 | /// Android only 38 | /// 39 | /// Get the navigation bar background color. 40 | static Future getNavigationBarColor() => 41 | _channel.invokeMethod('getnavigationbarcolor').then((dynamic value) { 42 | return value == null ? null : Color(value); 43 | }); 44 | 45 | /// Android only 46 | /// 47 | /// Set the navigation bar background color. 48 | /// The alpha of the input color will be ignoreed 49 | /// because of flutter's android layout. 50 | static Future setNavigationBarColor( 51 | Color color, { 52 | bool animate = false, 53 | }) => 54 | _channel.invokeMethod('setnavigationbarcolor', { 55 | 'color': color.value, 56 | 'animate': animate, 57 | }); 58 | 59 | /// Android only 60 | /// 61 | /// Set the navigation bar foreground brightness. 62 | /// Set to true, the color of the text and icon 63 | /// will be white, otherwise black. 64 | static Future setNavigationBarWhiteForeground( 65 | bool useWhiteForeground) => 66 | _channel.invokeMethod('setnavigationbarwhiteforeground', { 67 | 'whiteForeground': useWhiteForeground, 68 | }); 69 | } 70 | 71 | /// Help you choosing the black or white foreground color 72 | /// to improve the foreground visible. 73 | bool useWhiteForeground(Color backgroundColor) => 74 | 1.05 / (backgroundColor.computeLuminance() + 0.05) > 4.5; 75 | -------------------------------------------------------------------------------- /example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Using a CDN with CocoaPods 1.7.2 or later can save a lot of time on pod installation, but it's experimental rather than the default. 2 | # source 'https://cdn.cocoapods.org/' 3 | 4 | # Uncomment this line to define a global platform for your project 5 | # platform :ios, '9.0' 6 | 7 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 8 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 9 | 10 | project 'Runner', { 11 | 'Debug' => :debug, 12 | 'Profile' => :release, 13 | 'Release' => :release, 14 | } 15 | 16 | def parse_KV_file(file, separator='=') 17 | file_abs_path = File.expand_path(file) 18 | if !File.exists? file_abs_path 19 | return []; 20 | end 21 | pods_ary = [] 22 | skip_line_start_symbols = ["#", "/"] 23 | File.foreach(file_abs_path) { |line| 24 | next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } 25 | plugin = line.split(pattern=separator) 26 | if plugin.length == 2 27 | podname = plugin[0].strip() 28 | path = plugin[1].strip() 29 | podpath = File.expand_path("#{path}", file_abs_path) 30 | pods_ary.push({:name => podname, :path => podpath}); 31 | else 32 | puts "Invalid plugin specification: #{line}" 33 | end 34 | } 35 | return pods_ary 36 | end 37 | 38 | target 'Runner' do 39 | # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock 40 | # referring to absolute paths on developers' machines. 41 | system('rm -rf .symlinks') 42 | system('mkdir -p .symlinks/plugins') 43 | 44 | # Flutter Pods 45 | generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig') 46 | if generated_xcode_build_settings.empty? 47 | puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first." 48 | end 49 | generated_xcode_build_settings.map { |p| 50 | if p[:name] == 'FLUTTER_FRAMEWORK_DIR' 51 | symlink = File.join('.symlinks', 'flutter') 52 | File.symlink(File.dirname(p[:path]), symlink) 53 | pod 'Flutter', :path => File.join(symlink, File.basename(p[:path])) 54 | end 55 | } 56 | 57 | # Plugin Pods 58 | plugin_pods = parse_KV_file('../.flutter-plugins') 59 | plugin_pods.map { |p| 60 | symlink = File.join('.symlinks', 'plugins', p[:name]) 61 | File.symlink(p[:path], symlink) 62 | pod p[:name], :path => File.join(symlink, 'ios') 63 | } 64 | end 65 | 66 | # Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system. 67 | install! 'cocoapods', :disable_input_output_paths => true 68 | 69 | post_install do |installer| 70 | installer.pods_project.targets.each do |target| 71 | target.build_configurations.each do |config| 72 | config.build_settings['ENABLE_BITCODE'] = 'NO' 73 | end 74 | end 75 | end 76 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 56 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /ios/Classes/FlutterStatusbarcolorPlugin.m: -------------------------------------------------------------------------------- 1 | #import "FlutterStatusbarcolorPlugin.h" 2 | 3 | #define ANDROID_COLOR(c) [UIColor colorWithRed:((c>>16)&0xFF)/255.0 green:((c>>8)&0xFF)/255.0 blue:((c)&0xFF)/255.0 alpha:((c>>24)&0xFF)/255.0] 4 | 5 | @implementation FlutterStatusbarcolorPlugin 6 | 7 | + (void)registerWithRegistrar:(NSObject*)registrar { 8 | FlutterMethodChannel* channel = [FlutterMethodChannel 9 | methodChannelWithName:@"plugins.fuyumi.com/statusbar" 10 | binaryMessenger:[registrar messenger]]; 11 | FlutterStatusbarcolorPlugin* instance = [[FlutterStatusbarcolorPlugin alloc] init]; 12 | [registrar addMethodCallDelegate:instance channel:channel]; 13 | } 14 | 15 | static NSInteger statusBarViewTag = 38482458385; 16 | 17 | - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { 18 | if ([@"getstatusbarcolor" isEqualToString:call.method]) { 19 | UIColor *uicolor; 20 | UIView * statusBar = [self getStatusBarView]; 21 | uicolor = statusBar.backgroundColor; 22 | if(uicolor == nil) { 23 | // since it's nil default to transparent 24 | uicolor = UIColor.clearColor; 25 | } 26 | 27 | CGFloat red = 0; 28 | CGFloat green = 0; 29 | CGFloat blue = 0; 30 | CGFloat alpha = 0; 31 | if (![uicolor getRed:&red green:&green blue:&blue alpha:&alpha]) { 32 | CGFloat white; 33 | if ([uicolor getWhite:&white alpha:&alpha]) { 34 | red = green = blue = white; 35 | } 36 | } 37 | NSNumber *color = @(((int)(red * 255.0) << 16) | ((int)(green * 255.0) << 8) | (int)(blue * 255.0) | ((int)(alpha * 255.0) << 24)); 38 | result(color); 39 | } else if ([@"setstatusbarcolor" isEqualToString:call.method]) { 40 | NSNumber *color = call.arguments[@"color"]; 41 | UIView * statusBar = [self getStatusBarView]; 42 | int colors = [color intValue]; 43 | statusBar.backgroundColor = ANDROID_COLOR(colors); 44 | result(nil); 45 | } else if ([@"setstatusbarwhiteforeground" isEqualToString:call.method]) { 46 | NSNumber *usewhiteforeground = call.arguments[@"whiteForeground"]; 47 | if ([usewhiteforeground boolValue]) { 48 | [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:YES]; 49 | } else { 50 | if (@available(iOS 13, *)) { 51 | [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDarkContent animated:YES]; 52 | }else{ 53 | [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault animated:YES]; 54 | } 55 | } 56 | result(nil); 57 | } else if ([@"getnavigationbarcolor" isEqualToString:call.method]) { 58 | result(nil); 59 | } else if ([@"setnavigationbarcolor" isEqualToString:call.method]) { 60 | result(nil); 61 | } else if ([@"setnavigationbarwhiteforeground" isEqualToString:call.method]) { 62 | result(nil); 63 | } else { 64 | result(FlutterMethodNotImplemented); 65 | } 66 | } 67 | 68 | - (UIView*) getStatusBarView { 69 | if (@available(iOS 13, *)) { 70 | if([UIApplication sharedApplication].keyWindow != nil && 71 | [[UIApplication sharedApplication].keyWindow viewWithTag:statusBarViewTag] != nil) { 72 | return [[UIApplication sharedApplication].keyWindow viewWithTag:statusBarViewTag]; 73 | } 74 | else { 75 | UIView* statusBar = [[UIView alloc]initWithFrame:[UIApplication sharedApplication].keyWindow.windowScene.statusBarManager.statusBarFrame]; 76 | statusBar.tag = statusBarViewTag; 77 | [[UIApplication sharedApplication].keyWindow addSubview:statusBar]; 78 | return statusBar; 79 | } 80 | } 81 | else { 82 | return [[UIApplication sharedApplication] valueForKey:@"statusBar"]; 83 | } 84 | 85 | } 86 | 87 | @end 88 | -------------------------------------------------------------------------------- /android/src/main/kotlin/com/fuyumi/flutterstatusbarcolor/flutterstatusbarcolor/FlutterStatusbarcolorPlugin.kt: -------------------------------------------------------------------------------- 1 | package com.fuyumi.flutterstatusbarcolor.flutterstatusbarcolor 2 | 3 | import android.os.Build 4 | import android.app.Activity 5 | import android.view.View 6 | import android.animation.ValueAnimator 7 | import io.flutter.plugin.common.MethodChannel 8 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler 9 | import io.flutter.plugin.common.MethodChannel.Result 10 | import io.flutter.plugin.common.MethodCall 11 | import io.flutter.plugin.common.PluginRegistry.Registrar 12 | 13 | class FlutterStatusbarcolorPlugin private constructor(private val activity: Activity?) : MethodCallHandler { 14 | companion object { 15 | @JvmStatic 16 | fun registerWith(registrar: Registrar): Unit { 17 | val channel = MethodChannel(registrar.messenger(), "plugins.fuyumi.com/statusbar") 18 | channel.setMethodCallHandler(FlutterStatusbarcolorPlugin(registrar.activity())) 19 | } 20 | } 21 | 22 | override fun onMethodCall(call: MethodCall, result: Result): Unit { 23 | if (activity == null) return result.success(null) 24 | 25 | when (call.method) { 26 | "getstatusbarcolor" -> { 27 | var statusBarColor: Int = 0 28 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 29 | statusBarColor = activity.window.statusBarColor 30 | } 31 | result.success(statusBarColor) 32 | } 33 | "setstatusbarcolor" -> { 34 | val statusBarColor: Int = call.argument("color")!! 35 | val animate: Boolean = call.argument("animate")!! 36 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 37 | if (animate) { 38 | val colorAnim = ValueAnimator.ofArgb(activity.window.statusBarColor, statusBarColor) 39 | colorAnim.addUpdateListener { anim -> activity.window.statusBarColor = anim.animatedValue as Int } 40 | colorAnim.setDuration(300) 41 | colorAnim.start() 42 | } else { 43 | activity.window.statusBarColor = statusBarColor 44 | } 45 | } 46 | result.success(null) 47 | } 48 | "setstatusbarwhiteforeground" -> { 49 | val usewhiteforeground: Boolean = call.argument("whiteForeground")!! 50 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 51 | if (usewhiteforeground) { 52 | activity.window.decorView.systemUiVisibility = activity.window.decorView.systemUiVisibility and View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR.inv() 53 | } else { 54 | activity.window.decorView.systemUiVisibility = activity.window.decorView.systemUiVisibility or View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR 55 | } 56 | } 57 | result.success(null) 58 | } 59 | "getnavigationbarcolor" -> { 60 | var navigationBarColor: Int = 0 61 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 62 | navigationBarColor = activity.window.navigationBarColor 63 | } 64 | result.success(navigationBarColor) 65 | } 66 | "setnavigationbarcolor" -> { 67 | val navigationBarColor: Int = call.argument("color")!! 68 | val animate: Boolean = call.argument("animate")!! 69 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 70 | if (animate) { 71 | val colorAnim = ValueAnimator.ofArgb(activity.window.navigationBarColor, navigationBarColor) 72 | colorAnim.addUpdateListener { anim -> activity.window.navigationBarColor = anim.animatedValue as Int } 73 | colorAnim.setDuration(300) 74 | colorAnim.start() 75 | } else { 76 | activity.window.navigationBarColor = navigationBarColor 77 | } 78 | } 79 | result.success(null) 80 | } 81 | "setnavigationbarwhiteforeground" -> { 82 | val usewhiteforeground: Boolean = call.argument("whiteForeground")!! 83 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { 84 | if (usewhiteforeground) { 85 | activity.window.decorView.systemUiVisibility = activity.window.decorView.systemUiVisibility and View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR.inv() 86 | } else { 87 | activity.window.decorView.systemUiVisibility = activity.window.decorView.systemUiVisibility or View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR 88 | } 89 | } 90 | result.success(null) 91 | } 92 | else -> result.notImplemented() 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /flutter_statusbarcolor.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter/services.dart'; 5 | import 'package:flutter_statusbarcolor/flutter_statusbarcolor.dart'; 6 | 7 | main() => runApp(MyApp()); 8 | 9 | class MyApp extends StatefulWidget { 10 | @override 11 | _MyAppState createState() => _MyAppState(); 12 | } 13 | 14 | class _MyAppState extends State with WidgetsBindingObserver { 15 | Color _randomStatusColor = Colors.black; 16 | Color _randomNavigationColor = Colors.black; 17 | 18 | bool _useWhiteStatusBarForeground; 19 | bool _useWhiteNavigationBarForeground; 20 | 21 | @override 22 | initState() { 23 | super.initState(); 24 | WidgetsBinding.instance.addObserver(this); 25 | } 26 | 27 | @override 28 | dispose() { 29 | WidgetsBinding.instance.removeObserver(this); 30 | super.dispose(); 31 | } 32 | 33 | @override 34 | didChangeAppLifecycleState(AppLifecycleState state) { 35 | if (state == AppLifecycleState.resumed) { 36 | if (_useWhiteStatusBarForeground != null) 37 | FlutterStatusbarcolor.setStatusBarWhiteForeground( 38 | _useWhiteStatusBarForeground); 39 | if (_useWhiteNavigationBarForeground != null) 40 | FlutterStatusbarcolor.setNavigationBarWhiteForeground( 41 | _useWhiteNavigationBarForeground); 42 | } 43 | super.didChangeAppLifecycleState(state); 44 | } 45 | 46 | changeStatusColor(Color color) async { 47 | try { 48 | await FlutterStatusbarcolor.setStatusBarColor(color, animate: true); 49 | if (useWhiteForeground(color)) { 50 | FlutterStatusbarcolor.setStatusBarWhiteForeground(true); 51 | FlutterStatusbarcolor.setNavigationBarWhiteForeground(true); 52 | _useWhiteStatusBarForeground = true; 53 | _useWhiteNavigationBarForeground = true; 54 | } else { 55 | FlutterStatusbarcolor.setStatusBarWhiteForeground(false); 56 | FlutterStatusbarcolor.setNavigationBarWhiteForeground(false); 57 | _useWhiteStatusBarForeground = false; 58 | _useWhiteNavigationBarForeground = false; 59 | } 60 | } on PlatformException catch (e) { 61 | debugPrint(e.toString()); 62 | } 63 | } 64 | 65 | changeNavigationColor(Color color) async { 66 | try { 67 | await FlutterStatusbarcolor.setNavigationBarColor(color, animate: true); 68 | } on PlatformException catch (e) { 69 | debugPrint(e.toString()); 70 | } 71 | } 72 | 73 | @override 74 | Widget build(BuildContext context) { 75 | return MaterialApp( 76 | home: DefaultTabController( 77 | length: 2, 78 | child: Scaffold( 79 | appBar: AppBar( 80 | title: Text('Flutter statusbar color plugin example'), 81 | bottom: TabBar( 82 | tabs: [ 83 | Tab(text: 'Statusbar'), 84 | Tab(text: 'Navigationbar(android only)') 85 | ], 86 | ), 87 | ), 88 | body: TabBarView( 89 | children: [ 90 | Column( 91 | mainAxisSize: MainAxisSize.max, 92 | mainAxisAlignment: MainAxisAlignment.center, 93 | children: [ 94 | Builder(builder: (BuildContext context) { 95 | return FlatButton( 96 | onPressed: () => FlutterStatusbarcolor.getStatusBarColor() 97 | .then((Color color) { 98 | Scaffold.of(context).showSnackBar(SnackBar( 99 | content: Text(color.toString()), 100 | backgroundColor: color, 101 | duration: const Duration(milliseconds: 200), 102 | )); 103 | }), 104 | child: Text( 105 | 'Show Statusbar Color', 106 | style: TextStyle(color: Colors.white), 107 | ), 108 | color: Colors.black, 109 | ); 110 | }), 111 | Padding(padding: const EdgeInsets.all(10.0)), 112 | FlatButton( 113 | onPressed: () => changeStatusColor(Colors.transparent), 114 | child: Text('Transparent'), 115 | ), 116 | Padding(padding: const EdgeInsets.all(10.0)), 117 | FlatButton( 118 | onPressed: () { 119 | Color color = Colors.amberAccent; 120 | changeStatusColor(color); 121 | }, 122 | child: Text('amber-accent'), 123 | color: Colors.amberAccent, 124 | ), 125 | Padding(padding: const EdgeInsets.all(10.0)), 126 | FlatButton( 127 | onPressed: () => changeStatusColor(Colors.tealAccent), 128 | child: Text('teal-accent'), 129 | color: Colors.tealAccent, 130 | ), 131 | Padding(padding: const EdgeInsets.all(10.0)), 132 | FlatButton( 133 | onPressed: () => 134 | FlutterStatusbarcolor.setStatusBarWhiteForeground(true) 135 | .then((_) => _useWhiteStatusBarForeground = true), 136 | child: Text( 137 | 'light foreground', 138 | style: TextStyle(color: Colors.white), 139 | ), 140 | color: Colors.black, 141 | ), 142 | Padding(padding: const EdgeInsets.all(10.0)), 143 | FlatButton( 144 | onPressed: () => 145 | FlutterStatusbarcolor.setStatusBarWhiteForeground(false) 146 | .then((_) => _useWhiteStatusBarForeground = false), 147 | child: Text('dark foreground'), 148 | color: Colors.white, 149 | ), 150 | Padding(padding: const EdgeInsets.all(10.0)), 151 | FlatButton( 152 | onPressed: () { 153 | Random rnd = Random(); 154 | Color color = Color.fromARGB( 155 | 255, 156 | rnd.nextInt(255), 157 | rnd.nextInt(255), 158 | rnd.nextInt(255), 159 | ); 160 | changeStatusColor(color); 161 | setState(() => _randomStatusColor = color); 162 | }, 163 | child: Text( 164 | 'Random color', 165 | style: TextStyle( 166 | color: useWhiteForeground(_randomStatusColor) 167 | ? Colors.white 168 | : Colors.black, 169 | ), 170 | ), 171 | color: _randomStatusColor, 172 | ), 173 | ], 174 | ), 175 | Column( 176 | mainAxisSize: MainAxisSize.max, 177 | mainAxisAlignment: MainAxisAlignment.center, 178 | children: [ 179 | Builder(builder: (BuildContext context) { 180 | return FlatButton( 181 | onPressed: () => 182 | FlutterStatusbarcolor.getNavigationBarColor() 183 | .then((Color color) { 184 | Scaffold.of(context).showSnackBar(SnackBar( 185 | content: Text(color.toString()), 186 | backgroundColor: color, 187 | duration: const Duration(milliseconds: 200), 188 | )); 189 | }), 190 | child: Text( 191 | 'Show Navigationbar Color', 192 | style: TextStyle(color: Colors.white), 193 | ), 194 | color: Colors.black, 195 | ); 196 | }), 197 | Padding(padding: const EdgeInsets.all(10.0)), 198 | FlatButton( 199 | onPressed: () => changeNavigationColor(Colors.green[400]), 200 | child: Text('Green-400'), 201 | color: Colors.green[400], 202 | ), 203 | Padding(padding: const EdgeInsets.all(10.0)), 204 | FlatButton( 205 | onPressed: () => 206 | changeNavigationColor(Colors.lightBlue[100]), 207 | child: Text('LightBlue-100'), 208 | color: Colors.lightBlue[100], 209 | ), 210 | Padding(padding: const EdgeInsets.all(10.0)), 211 | FlatButton( 212 | onPressed: () => 213 | changeNavigationColor(Colors.cyanAccent[200]), 214 | child: Text('CyanAccent-200'), 215 | color: Colors.cyanAccent[200], 216 | ), 217 | Padding(padding: const EdgeInsets.all(10.0)), 218 | FlatButton( 219 | onPressed: () => FlutterStatusbarcolor 220 | .setNavigationBarWhiteForeground(true) 221 | .then((_) => _useWhiteNavigationBarForeground = true), 222 | child: Text( 223 | 'light foreground', 224 | style: TextStyle(color: Colors.white), 225 | ), 226 | color: Colors.black, 227 | ), 228 | Padding(padding: const EdgeInsets.all(10.0)), 229 | FlatButton( 230 | onPressed: () => FlutterStatusbarcolor 231 | .setNavigationBarWhiteForeground(false) 232 | .then((_) => _useWhiteNavigationBarForeground = false), 233 | child: Text('dark foreground'), 234 | color: Colors.white, 235 | ), 236 | Padding(padding: const EdgeInsets.all(10.0)), 237 | FlatButton( 238 | onPressed: () { 239 | Random rnd = Random(); 240 | Color color = Color.fromARGB( 241 | 255, 242 | rnd.nextInt(255), 243 | rnd.nextInt(255), 244 | rnd.nextInt(255), 245 | ); 246 | setState(() => _randomNavigationColor = color); 247 | changeNavigationColor(color); 248 | }, 249 | child: Text( 250 | 'Random color', 251 | style: TextStyle( 252 | color: useWhiteForeground(_randomNavigationColor) 253 | ? Colors.white 254 | : Colors.black, 255 | ), 256 | ), 257 | color: _randomNavigationColor, 258 | ), 259 | ], 260 | ), 261 | ], 262 | ), 263 | ), 264 | ), 265 | ); 266 | } 267 | } 268 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 13 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 14 | 8623AF27FF7DBA21F8BAE0E0 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E40671ABC6D99FA97A9B579F /* libPods-Runner.a */; }; 15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 17 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 18 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; }; 19 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 20 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 21 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 22 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 23 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXCopyFilesBuildPhase section */ 27 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 28 | isa = PBXCopyFilesBuildPhase; 29 | buildActionMask = 2147483647; 30 | dstPath = ""; 31 | dstSubfolderSpec = 10; 32 | files = ( 33 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 34 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 35 | ); 36 | name = "Embed Frameworks"; 37 | runOnlyForDeploymentPostprocessing = 0; 38 | }; 39 | /* End PBXCopyFilesBuildPhase section */ 40 | 41 | /* Begin PBXFileReference section */ 42 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 43 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 44 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 45 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 46 | 4971CA3686D140EBE14E92AD /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 47 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 48 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 49 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 50 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 51 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 52 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 53 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 55 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 56 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 57 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 58 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 59 | A5531BE4E6A36B7A05F0ACEC /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 60 | E40671ABC6D99FA97A9B579F /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 61 | /* End PBXFileReference section */ 62 | 63 | /* Begin PBXFrameworksBuildPhase section */ 64 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 69 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 70 | 8623AF27FF7DBA21F8BAE0E0 /* libPods-Runner.a in Frameworks */, 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | /* End PBXFrameworksBuildPhase section */ 75 | 76 | /* Begin PBXGroup section */ 77 | 15327468E92906FADCDEAAF4 /* Frameworks */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | E40671ABC6D99FA97A9B579F /* libPods-Runner.a */, 81 | ); 82 | name = Frameworks; 83 | sourceTree = ""; 84 | }; 85 | 758E4AD96075785D88868069 /* Pods */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | 4971CA3686D140EBE14E92AD /* Pods-Runner.debug.xcconfig */, 89 | A5531BE4E6A36B7A05F0ACEC /* Pods-Runner.release.xcconfig */, 90 | ); 91 | name = Pods; 92 | path = Pods; 93 | sourceTree = ""; 94 | }; 95 | 9740EEB11CF90186004384FC /* Flutter */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | 3B80C3931E831B6300D905FE /* App.framework */, 99 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 100 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 101 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 102 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 103 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 104 | ); 105 | name = Flutter; 106 | sourceTree = ""; 107 | }; 108 | 97C146E51CF9000F007C117D = { 109 | isa = PBXGroup; 110 | children = ( 111 | 9740EEB11CF90186004384FC /* Flutter */, 112 | 97C146F01CF9000F007C117D /* Runner */, 113 | 97C146EF1CF9000F007C117D /* Products */, 114 | 758E4AD96075785D88868069 /* Pods */, 115 | 15327468E92906FADCDEAAF4 /* Frameworks */, 116 | ); 117 | sourceTree = ""; 118 | }; 119 | 97C146EF1CF9000F007C117D /* Products */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 97C146EE1CF9000F007C117D /* Runner.app */, 123 | ); 124 | name = Products; 125 | sourceTree = ""; 126 | }; 127 | 97C146F01CF9000F007C117D /* Runner */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 131 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 132 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 133 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 134 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 135 | 97C147021CF9000F007C117D /* Info.plist */, 136 | 97C146F11CF9000F007C117D /* Supporting Files */, 137 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 138 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 139 | ); 140 | path = Runner; 141 | sourceTree = ""; 142 | }; 143 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 144 | isa = PBXGroup; 145 | children = ( 146 | 97C146F21CF9000F007C117D /* main.m */, 147 | ); 148 | name = "Supporting Files"; 149 | sourceTree = ""; 150 | }; 151 | /* End PBXGroup section */ 152 | 153 | /* Begin PBXNativeTarget section */ 154 | 97C146ED1CF9000F007C117D /* Runner */ = { 155 | isa = PBXNativeTarget; 156 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 157 | buildPhases = ( 158 | 9E8E520605734C1DD9D25125 /* [CP] Check Pods Manifest.lock */, 159 | 9740EEB61CF901F6004384FC /* Run Script */, 160 | 97C146EA1CF9000F007C117D /* Sources */, 161 | 97C146EB1CF9000F007C117D /* Frameworks */, 162 | 97C146EC1CF9000F007C117D /* Resources */, 163 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 164 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 165 | DE72C90A1B5579F1646C8F44 /* [CP] Embed Pods Frameworks */, 166 | ); 167 | buildRules = ( 168 | ); 169 | dependencies = ( 170 | ); 171 | name = Runner; 172 | productName = Runner; 173 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 174 | productType = "com.apple.product-type.application"; 175 | }; 176 | /* End PBXNativeTarget section */ 177 | 178 | /* Begin PBXProject section */ 179 | 97C146E61CF9000F007C117D /* Project object */ = { 180 | isa = PBXProject; 181 | attributes = { 182 | LastUpgradeCheck = 0910; 183 | ORGANIZATIONNAME = "The Chromium Authors"; 184 | TargetAttributes = { 185 | 97C146ED1CF9000F007C117D = { 186 | CreatedOnToolsVersion = 7.3.1; 187 | }; 188 | }; 189 | }; 190 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 191 | compatibilityVersion = "Xcode 3.2"; 192 | developmentRegion = English; 193 | hasScannedForEncodings = 0; 194 | knownRegions = ( 195 | en, 196 | Base, 197 | ); 198 | mainGroup = 97C146E51CF9000F007C117D; 199 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 200 | projectDirPath = ""; 201 | projectRoot = ""; 202 | targets = ( 203 | 97C146ED1CF9000F007C117D /* Runner */, 204 | ); 205 | }; 206 | /* End PBXProject section */ 207 | 208 | /* Begin PBXResourcesBuildPhase section */ 209 | 97C146EC1CF9000F007C117D /* Resources */ = { 210 | isa = PBXResourcesBuildPhase; 211 | buildActionMask = 2147483647; 212 | files = ( 213 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 214 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */, 215 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 216 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 217 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 218 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 219 | ); 220 | runOnlyForDeploymentPostprocessing = 0; 221 | }; 222 | /* End PBXResourcesBuildPhase section */ 223 | 224 | /* Begin PBXShellScriptBuildPhase section */ 225 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 226 | isa = PBXShellScriptBuildPhase; 227 | buildActionMask = 2147483647; 228 | files = ( 229 | ); 230 | inputPaths = ( 231 | ); 232 | name = "Thin Binary"; 233 | outputPaths = ( 234 | ); 235 | runOnlyForDeploymentPostprocessing = 0; 236 | shellPath = /bin/sh; 237 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 238 | }; 239 | 9740EEB61CF901F6004384FC /* Run Script */ = { 240 | isa = PBXShellScriptBuildPhase; 241 | buildActionMask = 2147483647; 242 | files = ( 243 | ); 244 | inputPaths = ( 245 | ); 246 | name = "Run Script"; 247 | outputPaths = ( 248 | ); 249 | runOnlyForDeploymentPostprocessing = 0; 250 | shellPath = /bin/sh; 251 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 252 | }; 253 | 9E8E520605734C1DD9D25125 /* [CP] Check Pods Manifest.lock */ = { 254 | isa = PBXShellScriptBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | ); 258 | inputFileListPaths = ( 259 | ); 260 | inputPaths = ( 261 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 262 | "${PODS_ROOT}/Manifest.lock", 263 | ); 264 | name = "[CP] Check Pods Manifest.lock"; 265 | outputFileListPaths = ( 266 | ); 267 | outputPaths = ( 268 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 269 | ); 270 | runOnlyForDeploymentPostprocessing = 0; 271 | shellPath = /bin/sh; 272 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 273 | showEnvVarsInLog = 0; 274 | }; 275 | DE72C90A1B5579F1646C8F44 /* [CP] Embed Pods Frameworks */ = { 276 | isa = PBXShellScriptBuildPhase; 277 | buildActionMask = 2147483647; 278 | files = ( 279 | ); 280 | inputPaths = ( 281 | ); 282 | name = "[CP] Embed Pods Frameworks"; 283 | outputPaths = ( 284 | ); 285 | runOnlyForDeploymentPostprocessing = 0; 286 | shellPath = /bin/sh; 287 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 288 | showEnvVarsInLog = 0; 289 | }; 290 | /* End PBXShellScriptBuildPhase section */ 291 | 292 | /* Begin PBXSourcesBuildPhase section */ 293 | 97C146EA1CF9000F007C117D /* Sources */ = { 294 | isa = PBXSourcesBuildPhase; 295 | buildActionMask = 2147483647; 296 | files = ( 297 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 298 | 97C146F31CF9000F007C117D /* main.m in Sources */, 299 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 300 | ); 301 | runOnlyForDeploymentPostprocessing = 0; 302 | }; 303 | /* End PBXSourcesBuildPhase section */ 304 | 305 | /* Begin PBXVariantGroup section */ 306 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 307 | isa = PBXVariantGroup; 308 | children = ( 309 | 97C146FB1CF9000F007C117D /* Base */, 310 | ); 311 | name = Main.storyboard; 312 | sourceTree = ""; 313 | }; 314 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 315 | isa = PBXVariantGroup; 316 | children = ( 317 | 97C147001CF9000F007C117D /* Base */, 318 | ); 319 | name = LaunchScreen.storyboard; 320 | sourceTree = ""; 321 | }; 322 | /* End PBXVariantGroup section */ 323 | 324 | /* Begin XCBuildConfiguration section */ 325 | 97C147031CF9000F007C117D /* Debug */ = { 326 | isa = XCBuildConfiguration; 327 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 328 | buildSettings = { 329 | ALWAYS_SEARCH_USER_PATHS = NO; 330 | CLANG_ANALYZER_NONNULL = YES; 331 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 332 | CLANG_CXX_LIBRARY = "libc++"; 333 | CLANG_ENABLE_MODULES = YES; 334 | CLANG_ENABLE_OBJC_ARC = YES; 335 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 336 | CLANG_WARN_BOOL_CONVERSION = YES; 337 | CLANG_WARN_COMMA = YES; 338 | CLANG_WARN_CONSTANT_CONVERSION = YES; 339 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 340 | CLANG_WARN_EMPTY_BODY = YES; 341 | CLANG_WARN_ENUM_CONVERSION = YES; 342 | CLANG_WARN_INFINITE_RECURSION = YES; 343 | CLANG_WARN_INT_CONVERSION = YES; 344 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 345 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 346 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 347 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 348 | CLANG_WARN_STRICT_PROTOTYPES = YES; 349 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 350 | CLANG_WARN_UNREACHABLE_CODE = YES; 351 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 352 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 353 | COPY_PHASE_STRIP = NO; 354 | DEBUG_INFORMATION_FORMAT = dwarf; 355 | ENABLE_STRICT_OBJC_MSGSEND = YES; 356 | ENABLE_TESTABILITY = YES; 357 | GCC_C_LANGUAGE_STANDARD = gnu99; 358 | GCC_DYNAMIC_NO_PIC = NO; 359 | GCC_NO_COMMON_BLOCKS = YES; 360 | GCC_OPTIMIZATION_LEVEL = 0; 361 | GCC_PREPROCESSOR_DEFINITIONS = ( 362 | "DEBUG=1", 363 | "$(inherited)", 364 | ); 365 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 366 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 367 | GCC_WARN_UNDECLARED_SELECTOR = YES; 368 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 369 | GCC_WARN_UNUSED_FUNCTION = YES; 370 | GCC_WARN_UNUSED_VARIABLE = YES; 371 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 372 | MTL_ENABLE_DEBUG_INFO = YES; 373 | ONLY_ACTIVE_ARCH = YES; 374 | SDKROOT = iphoneos; 375 | TARGETED_DEVICE_FAMILY = "1,2"; 376 | }; 377 | name = Debug; 378 | }; 379 | 97C147041CF9000F007C117D /* Release */ = { 380 | isa = XCBuildConfiguration; 381 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 382 | buildSettings = { 383 | ALWAYS_SEARCH_USER_PATHS = NO; 384 | CLANG_ANALYZER_NONNULL = YES; 385 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 386 | CLANG_CXX_LIBRARY = "libc++"; 387 | CLANG_ENABLE_MODULES = YES; 388 | CLANG_ENABLE_OBJC_ARC = YES; 389 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 390 | CLANG_WARN_BOOL_CONVERSION = YES; 391 | CLANG_WARN_COMMA = YES; 392 | CLANG_WARN_CONSTANT_CONVERSION = YES; 393 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 394 | CLANG_WARN_EMPTY_BODY = YES; 395 | CLANG_WARN_ENUM_CONVERSION = YES; 396 | CLANG_WARN_INFINITE_RECURSION = YES; 397 | CLANG_WARN_INT_CONVERSION = YES; 398 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 399 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 400 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 401 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 402 | CLANG_WARN_STRICT_PROTOTYPES = YES; 403 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 404 | CLANG_WARN_UNREACHABLE_CODE = YES; 405 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 406 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 407 | COPY_PHASE_STRIP = NO; 408 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 409 | ENABLE_NS_ASSERTIONS = NO; 410 | ENABLE_STRICT_OBJC_MSGSEND = YES; 411 | GCC_C_LANGUAGE_STANDARD = gnu99; 412 | GCC_NO_COMMON_BLOCKS = YES; 413 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 414 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 415 | GCC_WARN_UNDECLARED_SELECTOR = YES; 416 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 417 | GCC_WARN_UNUSED_FUNCTION = YES; 418 | GCC_WARN_UNUSED_VARIABLE = YES; 419 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 420 | MTL_ENABLE_DEBUG_INFO = NO; 421 | SDKROOT = iphoneos; 422 | TARGETED_DEVICE_FAMILY = "1,2"; 423 | VALIDATE_PRODUCT = YES; 424 | }; 425 | name = Release; 426 | }; 427 | 97C147061CF9000F007C117D /* Debug */ = { 428 | isa = XCBuildConfiguration; 429 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 430 | buildSettings = { 431 | ARCHS = arm64; 432 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 433 | ENABLE_BITCODE = NO; 434 | FRAMEWORK_SEARCH_PATHS = ( 435 | "$(inherited)", 436 | "$(PROJECT_DIR)/Flutter", 437 | ); 438 | INFOPLIST_FILE = Runner/Info.plist; 439 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 440 | LIBRARY_SEARCH_PATHS = ( 441 | "$(inherited)", 442 | "$(PROJECT_DIR)/Flutter", 443 | ); 444 | PRODUCT_BUNDLE_IDENTIFIER = com.fuyumi.flutter_statusbarcolor.flutterStatusbarcolorExample; 445 | PRODUCT_NAME = "$(TARGET_NAME)"; 446 | }; 447 | name = Debug; 448 | }; 449 | 97C147071CF9000F007C117D /* Release */ = { 450 | isa = XCBuildConfiguration; 451 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 452 | buildSettings = { 453 | ARCHS = arm64; 454 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 455 | ENABLE_BITCODE = NO; 456 | FRAMEWORK_SEARCH_PATHS = ( 457 | "$(inherited)", 458 | "$(PROJECT_DIR)/Flutter", 459 | ); 460 | INFOPLIST_FILE = Runner/Info.plist; 461 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 462 | LIBRARY_SEARCH_PATHS = ( 463 | "$(inherited)", 464 | "$(PROJECT_DIR)/Flutter", 465 | ); 466 | PRODUCT_BUNDLE_IDENTIFIER = com.fuyumi.flutter_statusbarcolor.flutterStatusbarcolorExample; 467 | PRODUCT_NAME = "$(TARGET_NAME)"; 468 | }; 469 | name = Release; 470 | }; 471 | /* End XCBuildConfiguration section */ 472 | 473 | /* Begin XCConfigurationList section */ 474 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 475 | isa = XCConfigurationList; 476 | buildConfigurations = ( 477 | 97C147031CF9000F007C117D /* Debug */, 478 | 97C147041CF9000F007C117D /* Release */, 479 | ); 480 | defaultConfigurationIsVisible = 0; 481 | defaultConfigurationName = Release; 482 | }; 483 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 484 | isa = XCConfigurationList; 485 | buildConfigurations = ( 486 | 97C147061CF9000F007C117D /* Debug */, 487 | 97C147071CF9000F007C117D /* Release */, 488 | ); 489 | defaultConfigurationIsVisible = 0; 490 | defaultConfigurationName = Release; 491 | }; 492 | /* End XCConfigurationList section */ 493 | }; 494 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 495 | } 496 | --------------------------------------------------------------------------------