File tree 1 file changed +7
-3
lines changed
packages/flutter/lib/src/material
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -910,15 +910,14 @@ class _MaterialAppState extends State<MaterialApp> {
910
910
);
911
911
}
912
912
913
- Widget _materialBuilder (BuildContext context, Widget ? child) {
913
+ ThemeData _themeBuilder (BuildContext context) {
914
+ ThemeData ? theme;
914
915
// Resolve which theme to use based on brightness and high contrast.
915
916
final ThemeMode mode = widget.themeMode ?? ThemeMode .system;
916
917
final Brightness platformBrightness = MediaQuery .platformBrightnessOf (context);
917
918
final bool useDarkTheme = mode == ThemeMode .dark
918
919
|| (mode == ThemeMode .system && platformBrightness == ui.Brightness .dark);
919
920
final bool highContrast = MediaQuery .highContrastOf (context);
920
- ThemeData ? theme;
921
-
922
921
if (useDarkTheme && highContrast && widget.highContrastDarkTheme != null ) {
923
922
theme = widget.highContrastDarkTheme;
924
923
} else if (useDarkTheme && widget.darkTheme != null ) {
@@ -927,6 +926,11 @@ class _MaterialAppState extends State<MaterialApp> {
927
926
theme = widget.highContrastTheme;
928
927
}
929
928
theme ?? = widget.theme ?? ThemeData .light ();
929
+ return theme;
930
+ }
931
+
932
+ Widget _materialBuilder (BuildContext context, Widget ? child) {
933
+ final ThemeData theme = _themeBuilder (context);
930
934
final Color effectiveSelectionColor = theme.textSelectionTheme.selectionColor ?? theme.colorScheme.primary.withOpacity (0.40 );
931
935
final Color effectiveCursorColor = theme.textSelectionTheme.cursorColor ?? theme.colorScheme.primary;
932
936
You can’t perform that action at this time.
0 commit comments