From 050721d3d435a944baf761ca6e0c27d1fa4422b1 Mon Sep 17 00:00:00 2001 From: miakh <2659269+miakh@users.noreply.github.com> Date: Tue, 19 Nov 2024 23:55:27 +0100 Subject: [PATCH] bottom appbar color all --- lib/pages/OccasionHomePage.dart | 3 +++ lib/services/StylesHelper.dart | 5 +++++ web/index.html | 3 +++ 3 files changed, 11 insertions(+) diff --git a/lib/pages/OccasionHomePage.dart b/lib/pages/OccasionHomePage.dart index 16840856..f22a9cb7 100644 --- a/lib/pages/OccasionHomePage.dart +++ b/lib/pages/OccasionHomePage.dart @@ -51,9 +51,12 @@ class _OccasionHomePageState extends State with WidgetsBinding @override void didChangeDependencies() { super.didChangeDependencies(); + SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle( + statusBarColor: ThemeConfig.appBarColor(), systemNavigationBarColor: ThemeConfig.appBarColor(), )); + StylesHelper.setBodyBackgroundColor(ThemeConfig.appBarColor()); StylesHelper.setMetaThemeColor(ThemeConfig.seed1); } diff --git a/lib/services/StylesHelper.dart b/lib/services/StylesHelper.dart index d83cb466..39f7e2de 100644 --- a/lib/services/StylesHelper.dart +++ b/lib/services/StylesHelper.dart @@ -16,4 +16,9 @@ class StylesHelper{ jsInterop.callMethod("setMetaThemeColor", [color.toHexString()]); } } + static void setBodyBackgroundColor(Color color) { + if(kIsWeb) { + jsInterop.callMethod("setBodyBackgroundColor", [color.toHexString()]); + } + } } \ No newline at end of file diff --git a/web/index.html b/web/index.html index cedcaf39..5bc06c48 100644 --- a/web/index.html +++ b/web/index.html @@ -139,6 +139,9 @@ function setMetaThemeColor(color) { document.querySelector('meta[name="theme-color"]').setAttribute("content", color); } + function setBodyBackgroundColor(color) { + document.body.style.backgroundColor = color; + }