Showing
1 changed file
with
12 additions
and
9 deletions
@@ -1043,15 +1043,17 @@ Since version 2.8 it is possible to access the properties | @@ -1043,15 +1043,17 @@ Since version 2.8 it is possible to access the properties | ||
1043 | return WidgetsBinding.instance; | 1043 | return WidgetsBinding.instance; |
1044 | } | 1044 | } |
1045 | 1045 | ||
1046 | - ///The window to which this binding is bound. | ||
1047 | - ui.SingletonFlutterWindow get window => ui.window; | 1046 | + //TODO: Change to ui.SingletonFlutterWindow rather dynamic |
1047 | + //when Flutter update stable. dynamic is used to avoid Breaking Changes | ||
1048 | + /// The window to which this binding is bound. | ||
1049 | + dynamic get window => ui.window; | ||
1048 | 1050 | ||
1049 | - Locale get deviceLocale => window.locale; | 1051 | + Locale get deviceLocale => ui.window.locale; |
1050 | 1052 | ||
1051 | ///The number of device pixels for each logical pixel. | 1053 | ///The number of device pixels for each logical pixel. |
1052 | - double get pixelRatio => window.devicePixelRatio; | 1054 | + double get pixelRatio => ui.window.devicePixelRatio; |
1053 | 1055 | ||
1054 | - Size get size => window.physicalSize / pixelRatio; | 1056 | + Size get size => ui.window.physicalSize / pixelRatio; |
1055 | 1057 | ||
1056 | ///The horizontal extent of this size. | 1058 | ///The horizontal extent of this size. |
1057 | double get width => size.width; | 1059 | double get width => size.width; |
@@ -1061,14 +1063,14 @@ Since version 2.8 it is possible to access the properties | @@ -1061,14 +1063,14 @@ Since version 2.8 it is possible to access the properties | ||
1061 | 1063 | ||
1062 | ///The distance from the top edge to the first unpadded pixel, | 1064 | ///The distance from the top edge to the first unpadded pixel, |
1063 | ///in physical pixels. | 1065 | ///in physical pixels. |
1064 | - double get statusBarHeight => window.padding.top; | 1066 | + double get statusBarHeight => ui.window.padding.top; |
1065 | 1067 | ||
1066 | ///The distance from the bottom edge to the first unpadded pixel, | 1068 | ///The distance from the bottom edge to the first unpadded pixel, |
1067 | ///in physical pixels. | 1069 | ///in physical pixels. |
1068 | - double get bottomBarHeight => window.padding.bottom; | 1070 | + double get bottomBarHeight => ui.window.padding.bottom; |
1069 | 1071 | ||
1070 | ///The system-reported text scale. | 1072 | ///The system-reported text scale. |
1071 | - double get textScaleFactor => window.textScaleFactor; | 1073 | + double get textScaleFactor => ui.window.textScaleFactor; |
1072 | 1074 | ||
1073 | /// give access to TextTheme.of(context) | 1075 | /// give access to TextTheme.of(context) |
1074 | TextTheme get textTheme => theme?.textTheme; | 1076 | TextTheme get textTheme => theme?.textTheme; |
@@ -1080,7 +1082,8 @@ Since version 2.8 it is possible to access the properties | @@ -1080,7 +1082,8 @@ Since version 2.8 it is possible to access the properties | ||
1080 | bool get isDarkMode => (theme.brightness == Brightness.dark); | 1082 | bool get isDarkMode => (theme.brightness == Brightness.dark); |
1081 | 1083 | ||
1082 | /// Check if dark mode theme is enable on platform on android Q+ | 1084 | /// Check if dark mode theme is enable on platform on android Q+ |
1083 | - bool get isPlatformDarkMode => (window.platformBrightness == Brightness.dark); | 1085 | + bool get isPlatformDarkMode => |
1086 | + (ui.window.platformBrightness == Brightness.dark); | ||
1084 | 1087 | ||
1085 | /// give access to Theme.of(context).iconTheme.color | 1088 | /// give access to Theme.of(context).iconTheme.color |
1086 | Color get iconColor => theme?.iconTheme?.color; | 1089 | Color get iconColor => theme?.iconTheme?.color; |
-
Please register or login to post a comment