Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
232063e5
Unverified
Commit
232063e5
authored
Feb 13, 2020
by
Greg Spencer
Committed by
GitHub
Feb 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed ThemeData DiagnosticProperties to DiagnosticLevel.debug (#50589)
parent
0634832a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
60 deletions
+73
-60
theme_data.dart
packages/flutter/lib/src/material/theme_data.dart
+59
-60
theme_data_test.dart
packages/flutter/test/material/theme_data_test.dart
+14
-0
No files found.
packages/flutter/lib/src/material/theme_data.dart
View file @
232063e5
...
...
@@ -1441,66 +1441,65 @@ class ThemeData extends Diagnosticable {
void
debugFillProperties
(
DiagnosticPropertiesBuilder
properties
)
{
super
.
debugFillProperties
(
properties
);
final
ThemeData
defaultData
=
ThemeData
.
fallback
();
properties
.
add
(
EnumProperty
<
TargetPlatform
>(
'platform'
,
platform
,
defaultValue:
defaultTargetPlatform
));
properties
.
add
(
EnumProperty
<
Brightness
>(
'brightness'
,
brightness
,
defaultValue:
defaultData
.
brightness
));
properties
.
add
(
DiagnosticsProperty
<
VisualDensity
>(
'visualDensity'
,
visualDensity
,
defaultValue:
defaultData
.
visualDensity
));
properties
.
add
(
ColorProperty
(
'primaryColor'
,
primaryColor
,
defaultValue:
defaultData
.
primaryColor
));
properties
.
add
(
EnumProperty
<
Brightness
>(
'primaryColorBrightness'
,
primaryColorBrightness
,
defaultValue:
defaultData
.
primaryColorBrightness
));
properties
.
add
(
ColorProperty
(
'accentColor'
,
accentColor
,
defaultValue:
defaultData
.
accentColor
));
properties
.
add
(
EnumProperty
<
Brightness
>(
'accentColorBrightness'
,
accentColorBrightness
,
defaultValue:
defaultData
.
accentColorBrightness
));
properties
.
add
(
ColorProperty
(
'canvasColor'
,
canvasColor
,
defaultValue:
defaultData
.
canvasColor
));
properties
.
add
(
ColorProperty
(
'scaffoldBackgroundColor'
,
scaffoldBackgroundColor
,
defaultValue:
defaultData
.
scaffoldBackgroundColor
));
properties
.
add
(
ColorProperty
(
'bottomAppBarColor'
,
bottomAppBarColor
,
defaultValue:
defaultData
.
bottomAppBarColor
));
properties
.
add
(
ColorProperty
(
'cardColor'
,
cardColor
,
defaultValue:
defaultData
.
cardColor
));
properties
.
add
(
ColorProperty
(
'dividerColor'
,
dividerColor
,
defaultValue:
defaultData
.
dividerColor
));
properties
.
add
(
ColorProperty
(
'focusColor'
,
focusColor
,
defaultValue:
defaultData
.
focusColor
));
properties
.
add
(
ColorProperty
(
'hoverColor'
,
hoverColor
,
defaultValue:
defaultData
.
hoverColor
));
properties
.
add
(
ColorProperty
(
'highlightColor'
,
highlightColor
,
defaultValue:
defaultData
.
highlightColor
));
properties
.
add
(
ColorProperty
(
'splashColor'
,
splashColor
,
defaultValue:
defaultData
.
splashColor
));
properties
.
add
(
ColorProperty
(
'selectedRowColor'
,
selectedRowColor
,
defaultValue:
defaultData
.
selectedRowColor
));
properties
.
add
(
ColorProperty
(
'unselectedWidgetColor'
,
unselectedWidgetColor
,
defaultValue:
defaultData
.
unselectedWidgetColor
));
properties
.
add
(
ColorProperty
(
'disabledColor'
,
disabledColor
,
defaultValue:
defaultData
.
disabledColor
));
properties
.
add
(
ColorProperty
(
'buttonColor'
,
buttonColor
,
defaultValue:
defaultData
.
buttonColor
));
properties
.
add
(
ColorProperty
(
'secondaryHeaderColor'
,
secondaryHeaderColor
,
defaultValue:
defaultData
.
secondaryHeaderColor
));
properties
.
add
(
ColorProperty
(
'textSelectionColor'
,
textSelectionColor
,
defaultValue:
defaultData
.
textSelectionColor
));
properties
.
add
(
ColorProperty
(
'cursorColor'
,
cursorColor
,
defaultValue:
defaultData
.
cursorColor
));
properties
.
add
(
ColorProperty
(
'textSelectionHandleColor'
,
textSelectionHandleColor
,
defaultValue:
defaultData
.
textSelectionHandleColor
));
properties
.
add
(
ColorProperty
(
'backgroundColor'
,
backgroundColor
,
defaultValue:
defaultData
.
backgroundColor
));
properties
.
add
(
ColorProperty
(
'dialogBackgroundColor'
,
dialogBackgroundColor
,
defaultValue:
defaultData
.
dialogBackgroundColor
));
properties
.
add
(
ColorProperty
(
'indicatorColor'
,
indicatorColor
,
defaultValue:
defaultData
.
indicatorColor
));
properties
.
add
(
ColorProperty
(
'hintColor'
,
hintColor
,
defaultValue:
defaultData
.
hintColor
));
properties
.
add
(
ColorProperty
(
'errorColor'
,
errorColor
,
defaultValue:
defaultData
.
errorColor
));
properties
.
add
(
ColorProperty
(
'toggleableActiveColor'
,
toggleableActiveColor
,
defaultValue:
defaultData
.
toggleableActiveColor
));
properties
.
add
(
DiagnosticsProperty
<
ButtonThemeData
>(
'buttonTheme'
,
buttonTheme
));
properties
.
add
(
DiagnosticsProperty
<
ToggleButtonsThemeData
>(
'toggleButtonsTheme'
,
toggleButtonsTheme
));
properties
.
add
(
DiagnosticsProperty
<
TextTheme
>(
'textTheme'
,
textTheme
));
properties
.
add
(
DiagnosticsProperty
<
TextTheme
>(
'primaryTextTheme'
,
primaryTextTheme
));
properties
.
add
(
DiagnosticsProperty
<
TextTheme
>(
'accentTextTheme'
,
accentTextTheme
));
properties
.
add
(
DiagnosticsProperty
<
InputDecorationTheme
>(
'inputDecorationTheme'
,
inputDecorationTheme
));
properties
.
add
(
DiagnosticsProperty
<
IconThemeData
>(
'iconTheme'
,
iconTheme
));
properties
.
add
(
DiagnosticsProperty
<
IconThemeData
>(
'primaryIconTheme'
,
primaryIconTheme
));
properties
.
add
(
DiagnosticsProperty
<
IconThemeData
>(
'accentIconTheme'
,
accentIconTheme
));
properties
.
add
(
DiagnosticsProperty
<
SliderThemeData
>(
'sliderTheme'
,
sliderTheme
));
properties
.
add
(
DiagnosticsProperty
<
TabBarTheme
>(
'tabBarTheme'
,
tabBarTheme
));
properties
.
add
(
DiagnosticsProperty
<
TooltipThemeData
>(
'tooltipTheme'
,
tooltipTheme
));
properties
.
add
(
DiagnosticsProperty
<
CardTheme
>(
'cardTheme'
,
cardTheme
));
properties
.
add
(
DiagnosticsProperty
<
ChipThemeData
>(
'chipTheme'
,
chipTheme
));
properties
.
add
(
DiagnosticsProperty
<
MaterialTapTargetSize
>(
'materialTapTargetSize'
,
materialTapTargetSize
));
properties
.
add
(
DiagnosticsProperty
<
bool
>(
'applyElevationOverlayColor'
,
applyElevationOverlayColor
));
properties
.
add
(
DiagnosticsProperty
<
PageTransitionsTheme
>(
'pageTransitionsTheme'
,
pageTransitionsTheme
));
properties
.
add
(
DiagnosticsProperty
<
AppBarTheme
>(
'appBarTheme'
,
appBarTheme
,
defaultValue:
defaultData
.
appBarTheme
));
properties
.
add
(
DiagnosticsProperty
<
BottomAppBarTheme
>(
'bottomAppBarTheme'
,
bottomAppBarTheme
,
defaultValue:
defaultData
.
bottomAppBarTheme
));
properties
.
add
(
DiagnosticsProperty
<
ColorScheme
>(
'colorScheme'
,
colorScheme
,
defaultValue:
defaultData
.
colorScheme
));
properties
.
add
(
DiagnosticsProperty
<
DialogTheme
>(
'dialogTheme'
,
dialogTheme
,
defaultValue:
defaultData
.
dialogTheme
));
properties
.
add
(
DiagnosticsProperty
<
FloatingActionButtonThemeData
>(
'floatingActionButtonThemeData'
,
floatingActionButtonTheme
,
defaultValue:
defaultData
.
floatingActionButtonTheme
));
properties
.
add
(
DiagnosticsProperty
<
Typography
>(
'typography'
,
typography
,
defaultValue:
defaultData
.
typography
));
properties
.
add
(
DiagnosticsProperty
<
CupertinoThemeData
>(
'cupertinoOverrideTheme'
,
cupertinoOverrideTheme
,
defaultValue:
defaultData
.
cupertinoOverrideTheme
));
properties
.
add
(
DiagnosticsProperty
<
SnackBarThemeData
>(
'snackBarTheme'
,
snackBarTheme
,
defaultValue:
defaultData
.
snackBarTheme
));
properties
.
add
(
DiagnosticsProperty
<
BottomSheetThemeData
>(
'bottomSheetTheme'
,
bottomSheetTheme
,
defaultValue:
defaultData
.
bottomSheetTheme
));
properties
.
add
(
DiagnosticsProperty
<
PopupMenuThemeData
>(
'popupMenuTheme'
,
popupMenuTheme
,
defaultValue:
defaultData
.
popupMenuTheme
));
properties
.
add
(
DiagnosticsProperty
<
MaterialBannerThemeData
>(
'bannerTheme'
,
bannerTheme
,
defaultValue:
defaultData
.
bannerTheme
));
properties
.
add
(
DiagnosticsProperty
<
DividerThemeData
>(
'dividerTheme'
,
dividerTheme
,
defaultValue:
defaultData
.
dividerTheme
));
properties
.
add
(
DiagnosticsProperty
<
ButtonBarThemeData
>(
'buttonBarTheme'
,
buttonBarTheme
,
defaultValue:
defaultData
.
buttonBarTheme
));
properties
.
add
(
EnumProperty
<
TargetPlatform
>(
'platform'
,
platform
,
defaultValue:
defaultTargetPlatform
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
EnumProperty
<
Brightness
>(
'brightness'
,
brightness
,
defaultValue:
defaultData
.
brightness
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'primaryColor'
,
primaryColor
,
defaultValue:
defaultData
.
primaryColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
EnumProperty
<
Brightness
>(
'primaryColorBrightness'
,
primaryColorBrightness
,
defaultValue:
defaultData
.
primaryColorBrightness
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'accentColor'
,
accentColor
,
defaultValue:
defaultData
.
accentColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
EnumProperty
<
Brightness
>(
'accentColorBrightness'
,
accentColorBrightness
,
defaultValue:
defaultData
.
accentColorBrightness
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'canvasColor'
,
canvasColor
,
defaultValue:
defaultData
.
canvasColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'scaffoldBackgroundColor'
,
scaffoldBackgroundColor
,
defaultValue:
defaultData
.
scaffoldBackgroundColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'bottomAppBarColor'
,
bottomAppBarColor
,
defaultValue:
defaultData
.
bottomAppBarColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'cardColor'
,
cardColor
,
defaultValue:
defaultData
.
cardColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'dividerColor'
,
dividerColor
,
defaultValue:
defaultData
.
dividerColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'focusColor'
,
focusColor
,
defaultValue:
defaultData
.
focusColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'hoverColor'
,
hoverColor
,
defaultValue:
defaultData
.
hoverColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'highlightColor'
,
highlightColor
,
defaultValue:
defaultData
.
highlightColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'splashColor'
,
splashColor
,
defaultValue:
defaultData
.
splashColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'selectedRowColor'
,
selectedRowColor
,
defaultValue:
defaultData
.
selectedRowColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'unselectedWidgetColor'
,
unselectedWidgetColor
,
defaultValue:
defaultData
.
unselectedWidgetColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'disabledColor'
,
disabledColor
,
defaultValue:
defaultData
.
disabledColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'buttonColor'
,
buttonColor
,
defaultValue:
defaultData
.
buttonColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'secondaryHeaderColor'
,
secondaryHeaderColor
,
defaultValue:
defaultData
.
secondaryHeaderColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'textSelectionColor'
,
textSelectionColor
,
defaultValue:
defaultData
.
textSelectionColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'cursorColor'
,
cursorColor
,
defaultValue:
defaultData
.
cursorColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'textSelectionHandleColor'
,
textSelectionHandleColor
,
defaultValue:
defaultData
.
textSelectionHandleColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'backgroundColor'
,
backgroundColor
,
defaultValue:
defaultData
.
backgroundColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'dialogBackgroundColor'
,
dialogBackgroundColor
,
defaultValue:
defaultData
.
dialogBackgroundColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'indicatorColor'
,
indicatorColor
,
defaultValue:
defaultData
.
indicatorColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'hintColor'
,
hintColor
,
defaultValue:
defaultData
.
hintColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'errorColor'
,
errorColor
,
defaultValue:
defaultData
.
errorColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'toggleableActiveColor'
,
toggleableActiveColor
,
defaultValue:
defaultData
.
toggleableActiveColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
ButtonThemeData
>(
'buttonTheme'
,
buttonTheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
ToggleButtonsThemeData
>(
'toggleButtonsTheme'
,
toggleButtonsTheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
TextTheme
>(
'textTheme'
,
textTheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
TextTheme
>(
'primaryTextTheme'
,
primaryTextTheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
TextTheme
>(
'accentTextTheme'
,
accentTextTheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
InputDecorationTheme
>(
'inputDecorationTheme'
,
inputDecorationTheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
IconThemeData
>(
'iconTheme'
,
iconTheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
IconThemeData
>(
'primaryIconTheme'
,
primaryIconTheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
IconThemeData
>(
'accentIconTheme'
,
accentIconTheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
SliderThemeData
>(
'sliderTheme'
,
sliderTheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
TabBarTheme
>(
'tabBarTheme'
,
tabBarTheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
TooltipThemeData
>(
'tooltipTheme'
,
tooltipTheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
CardTheme
>(
'cardTheme'
,
cardTheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
ChipThemeData
>(
'chipTheme'
,
chipTheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
MaterialTapTargetSize
>(
'materialTapTargetSize'
,
materialTapTargetSize
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
bool
>(
'applyElevationOverlayColor'
,
applyElevationOverlayColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
PageTransitionsTheme
>(
'pageTransitionsTheme'
,
pageTransitionsTheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
AppBarTheme
>(
'appBarTheme'
,
appBarTheme
,
defaultValue:
defaultData
.
appBarTheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
BottomAppBarTheme
>(
'bottomAppBarTheme'
,
bottomAppBarTheme
,
defaultValue:
defaultData
.
bottomAppBarTheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
ColorScheme
>(
'colorScheme'
,
colorScheme
,
defaultValue:
defaultData
.
colorScheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
DialogTheme
>(
'dialogTheme'
,
dialogTheme
,
defaultValue:
defaultData
.
dialogTheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
FloatingActionButtonThemeData
>(
'floatingActionButtonThemeData'
,
floatingActionButtonTheme
,
defaultValue:
defaultData
.
floatingActionButtonTheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
Typography
>(
'typography'
,
typography
,
defaultValue:
defaultData
.
typography
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
CupertinoThemeData
>(
'cupertinoOverrideTheme'
,
cupertinoOverrideTheme
,
defaultValue:
defaultData
.
cupertinoOverrideTheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
SnackBarThemeData
>(
'snackBarTheme'
,
snackBarTheme
,
defaultValue:
defaultData
.
snackBarTheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
BottomSheetThemeData
>(
'bottomSheetTheme'
,
bottomSheetTheme
,
defaultValue:
defaultData
.
bottomSheetTheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
PopupMenuThemeData
>(
'popupMenuTheme'
,
popupMenuTheme
,
defaultValue:
defaultData
.
popupMenuTheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
MaterialBannerThemeData
>(
'bannerTheme'
,
bannerTheme
,
defaultValue:
defaultData
.
bannerTheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
DividerThemeData
>(
'dividerTheme'
,
dividerTheme
,
defaultValue:
defaultData
.
dividerTheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
ButtonBarThemeData
>(
'buttonBarTheme'
,
buttonBarTheme
,
defaultValue:
defaultData
.
buttonBarTheme
,
level:
DiagnosticLevel
.
debug
));
}
}
...
...
packages/flutter/test/material/theme_data_test.dart
View file @
232063e5
...
...
@@ -476,4 +476,18 @@ void main() {
expect
(
themeDataCopy
.
buttonBarTheme
,
equals
(
otherTheme
.
buttonBarTheme
));
});
testWidgets
(
'ThemeData.toString has less than 200 characters output'
,
(
WidgetTester
tester
)
async
{
// This test makes sure that the ThemeData debug output doesn't get too
// verbose, which has been a problem in the past.
const
ColorScheme
darkColors
=
ColorScheme
.
dark
();
final
ThemeData
darkTheme
=
ThemeData
.
from
(
colorScheme:
darkColors
);
expect
(
darkTheme
.
toString
().
length
,
lessThan
(
200
));
const
ColorScheme
lightColors
=
ColorScheme
.
light
();
final
ThemeData
lightTheme
=
ThemeData
.
from
(
colorScheme:
lightColors
);
expect
(
lightTheme
.
toString
().
length
,
lessThan
(
200
));
});
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment