From 98a0818db212ff1cdf6de3a351c3de0716d063ed Mon Sep 17 00:00:00 2001 From: Ian VanSchooten Date: Wed, 28 Aug 2024 15:28:17 -0400 Subject: [PATCH] Avoid deprecated window property --- lib/main.dart | 2 +- lib/services/settings.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index b051cba..7adef60 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -32,7 +32,7 @@ class App extends StatefulWidget { class _AppState extends State { final settings = Settings(); - Brightness brightness = SchedulerBinding.instance.window.platformBrightness; + Brightness brightness = SchedulerBinding.instance.platformDispatcher.platformBrightness; StreamController dnEnrolled = StreamController.broadcast(); @override diff --git a/lib/services/settings.dart b/lib/services/settings.dart index 0f2bb39..d4d4742 100644 --- a/lib/services/settings.dart +++ b/lib/services/settings.dart @@ -22,7 +22,7 @@ class Settings { } bool get darkMode { - return _getBool('darkMode', SchedulerBinding.instance.window.platformBrightness == Brightness.dark); + return _getBool('darkMode', SchedulerBinding.instance.platformDispatcher.platformBrightness == Brightness.dark); } set darkMode(bool enabled) {