Skip to content

Commit

Permalink
Merge pull request #1 from rafaelmaeuer/master
Browse files Browse the repository at this point in the history
Fix MissingPluginException for flutter web
  • Loading branch information
NarHakobyan authored Jun 5, 2021
2 parents 02464cb + 2c7108a commit e81699c
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 6 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion example/.flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -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"}
{"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"}
6 changes: 4 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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.
Expand Down
10 changes: 10 additions & 0 deletions lib/flutter_statusbar_manager.dart
Original file line number Diff line number Diff line change
@@ -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 }

Expand Down Expand Up @@ -64,49 +65,58 @@ class FlutterStatusbarManager {
const MethodChannel('flutter_statusbar_manager');

static Future<bool> setColor(Color color, {bool animated = false}) async {
if (kIsWeb) return false;
return await _channel
.invokeMethod("setColor", {'color': color.value, 'animated': animated});
}

static Future<bool> setTranslucent(bool translucent) async {
if (kIsWeb) return false;
return await _channel
.invokeMethod("setTranslucent", {'translucent': translucent});
}

static Future<bool> setHidden(bool hidden,
{StatusBarAnimation animation = StatusBarAnimation.NONE}) async {
if (kIsWeb) return false;
return await _channel.invokeMethod("setHidden", {
'hidden': hidden,
'animation': _StatusBarAnimation.getAnimation(animation)
});
}

static Future<bool> setStyle(StatusBarStyle style) async {
if (kIsWeb) return false;
return await _channel
.invokeMethod("setStyle", {'style': _StatusBarStyle.getStyle(style)});
}

static Future<bool> setNetworkActivityIndicatorVisible(bool visible) async {
if (kIsWeb) return false;
return await _channel.invokeMethod(
"setNetworkActivityIndicatorVisible", {'visible': visible});
}

static Future<bool> setNavigationBarColor(Color color,
{bool animated = false}) async {
if (kIsWeb) return false;
return await _channel.invokeMethod(
"setNavigationBarColor", {'color': color.value, 'animated': animated});
}

static Future<bool> setNavigationBarStyle(NavigationBarStyle style) async {
if (kIsWeb) return false;
return await _channel.invokeMethod("setNavigationBarStyle",
{'style': _NavigationBarStyle.getStyle(style)});
}

static Future<double> 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 {
Expand Down
5 changes: 2 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
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:
flutter:
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:
Expand Down

0 comments on commit e81699c

Please sign in to comment.