From 9b3411722899b6b434c1acf49a115fad2175b6ee Mon Sep 17 00:00:00 2001 From: Mais Date: Thu, 8 Aug 2024 14:49:19 +0300 Subject: [PATCH] chore: remove deprecated use of MediaQuery --- lib/models/theme.dart | 5 ++--- lib/pages/tabs/page_3_counter/counter_list_view.dart | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/models/theme.dart b/lib/models/theme.dart index c401f5f..c72cb49 100644 --- a/lib/models/theme.dart +++ b/lib/models/theme.dart @@ -1,3 +1,4 @@ +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:noor/exports/constants.dart' show Images; import 'package:noor/exports/services.dart' show SharedPrefsService; @@ -8,9 +9,7 @@ class ThemeModel with ChangeNotifier { String _userTheme = SharedPrefsService.getString('theme'); String get userTheme => _userTheme; - Brightness get brightness => - MediaQueryData.fromView(WidgetsBinding.instance.window) - .platformBrightness; + Brightness get brightness => PlatformDispatcher.instance.platformBrightness; set userTheme(String value) { _userTheme = value; diff --git a/lib/pages/tabs/page_3_counter/counter_list_view.dart b/lib/pages/tabs/page_3_counter/counter_list_view.dart index 0d823c2..cf2343d 100644 --- a/lib/pages/tabs/page_3_counter/counter_list_view.dart +++ b/lib/pages/tabs/page_3_counter/counter_list_view.dart @@ -8,7 +8,6 @@ import 'package:noor/exports/controllers.dart'; import 'package:noor/exports/pages.dart'; import 'package:noor/pages/tabs/page_3_counter/counter_view_model.dart'; import 'package:noor/utils/build_context.dart'; -import 'package:noor/utils/to_arabic.dart'; import 'package:provider/provider.dart'; const kMaxLength = 75;