|
1 | 1 | import 'dart:async';
|
2 | 2 | import 'package:flutter/material.dart';
|
3 | 3 | import 'package:flutter/services.dart';
|
| 4 | +import 'package:flutter/foundation.dart' show kIsWeb; |
4 | 5 |
|
5 | 6 | enum StatusBarStyle { DEFAULT, LIGHT_CONTENT, DARK_CONTENT }
|
6 | 7 |
|
@@ -64,49 +65,58 @@ class FlutterStatusbarManager {
|
64 | 65 | const MethodChannel('flutter_statusbar_manager');
|
65 | 66 |
|
66 | 67 | static Future<bool> setColor(Color color, {bool animated = false}) async {
|
| 68 | + if (kIsWeb) return false; |
67 | 69 | return await _channel
|
68 | 70 | .invokeMethod("setColor", {'color': color.value, 'animated': animated});
|
69 | 71 | }
|
70 | 72 |
|
71 | 73 | static Future<bool> setTranslucent(bool translucent) async {
|
| 74 | + if (kIsWeb) return false; |
72 | 75 | return await _channel
|
73 | 76 | .invokeMethod("setTranslucent", {'translucent': translucent});
|
74 | 77 | }
|
75 | 78 |
|
76 | 79 | static Future<bool> setHidden(bool hidden,
|
77 | 80 | {StatusBarAnimation animation = StatusBarAnimation.NONE}) async {
|
| 81 | + if (kIsWeb) return false; |
78 | 82 | return await _channel.invokeMethod("setHidden", {
|
79 | 83 | 'hidden': hidden,
|
80 | 84 | 'animation': _StatusBarAnimation.getAnimation(animation)
|
81 | 85 | });
|
82 | 86 | }
|
83 | 87 |
|
84 | 88 | static Future<bool> setStyle(StatusBarStyle style) async {
|
| 89 | + if (kIsWeb) return false; |
85 | 90 | return await _channel
|
86 | 91 | .invokeMethod("setStyle", {'style': _StatusBarStyle.getStyle(style)});
|
87 | 92 | }
|
88 | 93 |
|
89 | 94 | static Future<bool> setNetworkActivityIndicatorVisible(bool visible) async {
|
| 95 | + if (kIsWeb) return false; |
90 | 96 | return await _channel.invokeMethod(
|
91 | 97 | "setNetworkActivityIndicatorVisible", {'visible': visible});
|
92 | 98 | }
|
93 | 99 |
|
94 | 100 | static Future<bool> setNavigationBarColor(Color color,
|
95 | 101 | {bool animated = false}) async {
|
| 102 | + if (kIsWeb) return false; |
96 | 103 | return await _channel.invokeMethod(
|
97 | 104 | "setNavigationBarColor", {'color': color.value, 'animated': animated});
|
98 | 105 | }
|
99 | 106 |
|
100 | 107 | static Future<bool> setNavigationBarStyle(NavigationBarStyle style) async {
|
| 108 | + if (kIsWeb) return false; |
101 | 109 | return await _channel.invokeMethod("setNavigationBarStyle",
|
102 | 110 | {'style': _NavigationBarStyle.getStyle(style)});
|
103 | 111 | }
|
104 | 112 |
|
105 | 113 | static Future<double> get getHeight async {
|
| 114 | + if (kIsWeb) return 0.0; |
106 | 115 | return await _channel.invokeMethod("getHeight");
|
107 | 116 | }
|
108 | 117 |
|
109 | 118 | static setFullscreen(bool value) {
|
| 119 | + if (kIsWeb) return; |
110 | 120 | if (value) {
|
111 | 121 | SystemChrome.setEnabledSystemUIOverlays([]);
|
112 | 122 | } else {
|
|
0 commit comments