From 9952803a54f22ca3cca1aea3714a3e0ee7d1ddba Mon Sep 17 00:00:00 2001 From: AlaaElattar Date: Thu, 3 Oct 2024 14:33:01 +0300 Subject: [PATCH] improve condition in preference_screen --- app/lib/screens/preference_screen.dart | 10 +++++----- app/pubspec.lock | 12 ++++++------ app/pubspec.yaml | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/lib/screens/preference_screen.dart b/app/lib/screens/preference_screen.dart index 1732ef8c..6111afa3 100644 --- a/app/lib/screens/preference_screen.dart +++ b/app/lib/screens/preference_screen.dart @@ -78,14 +78,14 @@ class _PreferenceScreenState extends State { @override Widget build(BuildContext context) { final themeProvider = Provider.of(context); - bool isSystemDarkMode = false; + bool isDarkMode; if (themeProvider.themeMode == ThemeMode.system){ - var brightness = + final brightness = SchedulerBinding.instance.platformDispatcher.platformBrightness; - isSystemDarkMode = brightness == Brightness.dark; + isDarkMode = brightness == Brightness.dark; + } else { + isDarkMode = themeProvider.themeMode == ThemeMode.dark; } - bool isDarkMode = themeProvider.themeMode == ThemeMode.dark || - (themeProvider.themeMode == ThemeMode.system && isSystemDarkMode); return LayoutDrawer( titleText: 'Settings', content: ListView( diff --git a/app/pubspec.lock b/app/pubspec.lock index 245bab07..065b0968 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -477,8 +477,8 @@ packages: dependency: "direct main" description: path: "packages/gridproxy_client" - ref: tfchain_graphql_hotfix - resolved-ref: "314f46728e43cb86f430cda6ba756d4be3fb6e07" + ref: tfchain_graphql + resolved-ref: "34c29c3d39530dae2843fbe3ad47307db6d28a23" url: "https://github.com/codescalers/tfgrid-sdk-dart" source: git version: "1.0.0" @@ -1244,8 +1244,8 @@ packages: dependency: "direct main" description: path: "packages/stellar_client" - ref: tfchain_graphql_hotfix_2 - resolved-ref: "563cc0297d79dc333157fe69a7540f0190ff3496" + ref: tfchain_graphql + resolved-ref: "34c29c3d39530dae2843fbe3ad47307db6d28a23" url: "https://github.com/codescalers/tfgrid-sdk-dart" source: git version: "0.1.0" @@ -1333,8 +1333,8 @@ packages: dependency: "direct main" description: path: "packages/tfchain_client" - ref: tfchain_graphql_hotfix - resolved-ref: "314f46728e43cb86f430cda6ba756d4be3fb6e07" + ref: tfchain_graphql + resolved-ref: "34c29c3d39530dae2843fbe3ad47307db6d28a23" url: "https://github.com/codescalers/tfgrid-sdk-dart" source: git version: "0.1.0" diff --git a/app/pubspec.yaml b/app/pubspec.yaml index ad6d23cb..7660e029 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -19,17 +19,17 @@ dependencies: tfchain_client: git: url: https://github.com/codescalers/tfgrid-sdk-dart - ref: tfchain_graphql_hotfix + ref: tfchain_graphql path: packages/tfchain_client stellar_client: git: url: https://github.com/codescalers/tfgrid-sdk-dart - ref: tfchain_graphql_hotfix_2 + ref: tfchain_graphql path: packages/stellar_client gridproxy_client: git: url: https://github.com/codescalers/tfgrid-sdk-dart - ref: tfchain_graphql_hotfix + ref: tfchain_graphql path: packages/gridproxy_client shuftipro_onsite_sdk: ^1.0.5 flutter_svg: ^2.0.6