Skip to content

Commit 2c7108a

Browse files
committed
Fix MissingPluginException for flutter web
1 parent 02464cb commit 2c7108a

6 files changed

+27
-6
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 3.0.1
2+
* Fix MissingPluginException for flutter web
3+
* Thanks to https://github.com/rafaelmaeuer
4+
5+
## 3.0.0
6+
* Added support for null safety
7+
* Thanks to https://github.com/NarHakobyan
8+
19
## 2.0.0
210
* Fix android X
311
* Fix iOS Dark mode styles

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# flutter_statusbar_manager
22

3+
Now compatible with flutter web thanks to https://github.com/rafaelmaeuer
4+
Now with support for null safety thanks to https://github.com/NarHakobyan
35
Now compatible with AndroidX thanks to https://github.com/lorenzOliveto
46

57
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.

example/.flutter-plugins-dependencies

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +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"}
1+
{"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"}

example/pubspec.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
name: flutter_statusbar_manager_example
22
description: Demonstrates how to use the flutter_statusbar_manager plugin.
33

4+
environment:
5+
sdk: ">=2.12.0 <3.0.0"
6+
47
dependencies:
58
flutter:
69
sdk: flutter
710

811
# The following adds the Cupertino Icons font to your application.
912
# Use with the CupertinoIcons class for iOS style icons.
10-
cupertino_icons: ^0.1.3
13+
cupertino_icons: ^1.0.3
1114

1215
dev_dependencies:
1316
flutter_test:
@@ -21,7 +24,6 @@ dev_dependencies:
2124

2225
# The following section is specific to Flutter.
2326
flutter:
24-
2527
# The following line ensures that the Material Icons font is
2628
# included with your application, so that you can use the icons in
2729
# the material Icons class.

lib/flutter_statusbar_manager.dart

+10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'dart:async';
22
import 'package:flutter/material.dart';
33
import 'package:flutter/services.dart';
4+
import 'package:flutter/foundation.dart' show kIsWeb;
45

56
enum StatusBarStyle { DEFAULT, LIGHT_CONTENT, DARK_CONTENT }
67

@@ -64,49 +65,58 @@ class FlutterStatusbarManager {
6465
const MethodChannel('flutter_statusbar_manager');
6566

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

7173
static Future<bool> setTranslucent(bool translucent) async {
74+
if (kIsWeb) return false;
7275
return await _channel
7376
.invokeMethod("setTranslucent", {'translucent': translucent});
7477
}
7578

7679
static Future<bool> setHidden(bool hidden,
7780
{StatusBarAnimation animation = StatusBarAnimation.NONE}) async {
81+
if (kIsWeb) return false;
7882
return await _channel.invokeMethod("setHidden", {
7983
'hidden': hidden,
8084
'animation': _StatusBarAnimation.getAnimation(animation)
8185
});
8286
}
8387

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

8994
static Future<bool> setNetworkActivityIndicatorVisible(bool visible) async {
95+
if (kIsWeb) return false;
9096
return await _channel.invokeMethod(
9197
"setNetworkActivityIndicatorVisible", {'visible': visible});
9298
}
9399

94100
static Future<bool> setNavigationBarColor(Color color,
95101
{bool animated = false}) async {
102+
if (kIsWeb) return false;
96103
return await _channel.invokeMethod(
97104
"setNavigationBarColor", {'color': color.value, 'animated': animated});
98105
}
99106

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

105113
static Future<double> get getHeight async {
114+
if (kIsWeb) return 0.0;
106115
return await _channel.invokeMethod("getHeight");
107116
}
108117

109118
static setFullscreen(bool value) {
119+
if (kIsWeb) return;
110120
if (value) {
111121
SystemChrome.setEnabledSystemUIOverlays([]);
112122
} else {

pubspec.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
name: flutter_statusbar_manager
22
description: Flutter Statusbar Manager, lets you control the status bar color, style (theme), visibility, and translucent properties across iOS and Android.
3-
version: 2.0.0
3+
version: 3.0.1
44
homepage: https://github.com/FooStudio/flutter_statusbar_manager
55

66
dependencies:
77
flutter:
88
sdk: flutter
99

1010
environment:
11-
sdk: '>=2.12.0 <3.0.0'
12-
flutter: ">=1.12.0 <2.0.0"
11+
sdk: ">=2.12.0 <3.0.0"
1312

1413
dev_dependencies:
1514
flutter_test:

0 commit comments

Comments
 (0)