From fbcc84291458c4e40dafbe9af5d7174e37cf228e Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 5 Feb 2024 13:20:30 +0000 Subject: [PATCH] Added a check of kIsWeb before Platform.isAndroid due to this bug in flutter: https://github.com/flutter/flutter/issues/50845 --- lib/src/components/banners/system_banner.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/src/components/banners/system_banner.dart b/lib/src/components/banners/system_banner.dart index deccf34a..40f2cc34 100644 --- a/lib/src/components/banners/system_banner.dart +++ b/lib/src/components/banners/system_banner.dart @@ -1,5 +1,6 @@ import 'dart:io'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import '../../../zeta_flutter.dart'; @@ -38,10 +39,10 @@ class ZetaSystemBanner extends MaterialBanner { builder: (context) { final backgroundColor = _backgroundColorFromType(context, type); final foregroundColor = backgroundColor.onColor; - if (context.mounted) { + if (!kIsWeb && Platform.isAndroid && context.mounted) { // ignore: invalid_use_of_visible_for_testing_member final statusBarColor = SystemChrome.latestStyle?.statusBarColor; - if (Platform.isAndroid && statusBarColor != backgroundColor) { + if (statusBarColor != backgroundColor) { SystemChrome.setSystemUIOverlayStyle( SystemUiOverlayStyle( statusBarColor: backgroundColor,