diff --git a/CHANGELOG.md b/CHANGELOG.md index b38cf0b..c98705a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## 3.0.1 +* Fix MissingPluginException for flutter web +* Thanks to https://github.com/rafaelmaeuer + +## 3.0.0 +* Added support for null safety +* Thanks to https://github.com/NarHakobyan + ## 2.0.0 * Fix android X * Fix iOS Dark mode styles diff --git a/README.md b/README.md index c063a2e..c1fae7b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # flutter_statusbar_manager +Now compatible with flutter web thanks to https://github.com/rafaelmaeuer +Now with support for null safety thanks to https://github.com/NarHakobyan Now compatible with AndroidX thanks to https://github.com/lorenzOliveto Flutter Statusbar Manager, lets you control the status bar color, style (theme), visibility, and translucent properties across iOS and Android. With some added bonus for Android to control the Navigation Bar. diff --git a/example/.flutter-plugins-dependencies b/example/.flutter-plugins-dependencies index 4cbcfc1..567717a 100644 --- a/example/.flutter-plugins-dependencies +++ b/example/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_statusbar_manager","path":"/Users/mendieta/Projects/flutter_statusbar_manager/","dependencies":[]}],"android":[{"name":"flutter_statusbar_manager","path":"/Users/mendieta/Projects/flutter_statusbar_manager/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"flutter_statusbar_manager","dependencies":[]}],"date_created":"2020-08-27 12:17:36.551472","version":"1.20.2"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_statusbar_manager","path":"/Users/rafael/Development/Public/flutter/flutter_statusbar_manager/","dependencies":[]}],"android":[{"name":"flutter_statusbar_manager","path":"/Users/rafael/Development/Public/flutter/flutter_statusbar_manager/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"flutter_statusbar_manager","dependencies":[]}],"date_created":"2021-06-04 22:29:15.118836","version":"2.2.1"} \ No newline at end of file diff --git a/example/pubspec.yaml b/example/pubspec.yaml index c172632..950958a 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,13 +1,16 @@ name: flutter_statusbar_manager_example description: Demonstrates how to use the flutter_statusbar_manager plugin. +environment: + sdk: ">=2.12.0 <3.0.0" + dependencies: flutter: sdk: flutter # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^0.1.3 + cupertino_icons: ^1.0.3 dev_dependencies: flutter_test: @@ -21,7 +24,6 @@ dev_dependencies: # The following section is specific to Flutter. flutter: - # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in # the material Icons class. diff --git a/lib/flutter_statusbar_manager.dart b/lib/flutter_statusbar_manager.dart index d32c1d2..fc314b7 100644 --- a/lib/flutter_statusbar_manager.dart +++ b/lib/flutter_statusbar_manager.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:flutter/foundation.dart' show kIsWeb; enum StatusBarStyle { DEFAULT, LIGHT_CONTENT, DARK_CONTENT } @@ -64,17 +65,20 @@ class FlutterStatusbarManager { const MethodChannel('flutter_statusbar_manager'); static Future setColor(Color color, {bool animated = false}) async { + if (kIsWeb) return false; return await _channel .invokeMethod("setColor", {'color': color.value, 'animated': animated}); } static Future setTranslucent(bool translucent) async { + if (kIsWeb) return false; return await _channel .invokeMethod("setTranslucent", {'translucent': translucent}); } static Future setHidden(bool hidden, {StatusBarAnimation animation = StatusBarAnimation.NONE}) async { + if (kIsWeb) return false; return await _channel.invokeMethod("setHidden", { 'hidden': hidden, 'animation': _StatusBarAnimation.getAnimation(animation) @@ -82,31 +86,37 @@ class FlutterStatusbarManager { } static Future setStyle(StatusBarStyle style) async { + if (kIsWeb) return false; return await _channel .invokeMethod("setStyle", {'style': _StatusBarStyle.getStyle(style)}); } static Future setNetworkActivityIndicatorVisible(bool visible) async { + if (kIsWeb) return false; return await _channel.invokeMethod( "setNetworkActivityIndicatorVisible", {'visible': visible}); } static Future setNavigationBarColor(Color color, {bool animated = false}) async { + if (kIsWeb) return false; return await _channel.invokeMethod( "setNavigationBarColor", {'color': color.value, 'animated': animated}); } static Future setNavigationBarStyle(NavigationBarStyle style) async { + if (kIsWeb) return false; return await _channel.invokeMethod("setNavigationBarStyle", {'style': _NavigationBarStyle.getStyle(style)}); } static Future get getHeight async { + if (kIsWeb) return 0.0; return await _channel.invokeMethod("getHeight"); } static setFullscreen(bool value) { + if (kIsWeb) return; if (value) { SystemChrome.setEnabledSystemUIOverlays([]); } else { diff --git a/pubspec.yaml b/pubspec.yaml index 4868835..3ebeed1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_statusbar_manager description: Flutter Statusbar Manager, lets you control the status bar color, style (theme), visibility, and translucent properties across iOS and Android. -version: 2.0.0 +version: 3.0.1 homepage: https://github.com/FooStudio/flutter_statusbar_manager dependencies: @@ -8,8 +8,7 @@ dependencies: sdk: flutter environment: - sdk: '>=2.12.0 <3.0.0' - flutter: ">=1.12.0 <2.0.0" + sdk: ">=2.12.0 <3.0.0" dev_dependencies: flutter_test: