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
e1a96b81
Unverified
Commit
e1a96b81
authored
Nov 16, 2021
by
Pierre-Louis
Committed by
GitHub
Nov 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate `primaryColorBrightness` (#93396)
parent
8612f80a
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
96 additions
and
27 deletions
+96
-27
fix_data.yaml
packages/flutter/lib/fix_data.yaml
+32
-0
app_bar.dart
packages/flutter/lib/src/material/app_bar.dart
+1
-1
text_field.dart
packages/flutter/lib/src/material/text_field.dart
+2
-2
theme_data.dart
packages/flutter/lib/src/material/theme_data.dart
+42
-18
circle_avatar_test.dart
packages/flutter/test/material/circle_avatar_test.dart
+0
-1
theme_data_test.dart
packages/flutter/test/material/theme_data_test.dart
+5
-5
material.dart
packages/flutter/test_fixes/material.dart
+7
-0
material.dart.expect
packages/flutter/test_fixes/material.dart.expect
+7
-0
No files found.
packages/flutter/lib/fix_data.yaml
View file @
e1a96b81
...
@@ -14,6 +14,38 @@
...
@@ -14,6 +14,38 @@
version
:
1
version
:
1
transforms
:
transforms
:
# Changes made in https://github.com/flutter/flutter/pull/93396
-
title
:
"
Remove
'primaryColorBrightness'"
date
:
2021-11-11
element
:
uris
:
[
'
material.dart'
]
method
:
'
copyWith'
inClass
:
'
ThemeData'
changes
:
-
kind
:
'
removeParameter'
name
:
'
primaryColorBrightness'
# Changes made in https://github.com/flutter/flutter/pull/93396
-
title
:
"
Remove
'primaryColorBrightness'"
date
:
2021-11-11
element
:
uris
:
[
'
material.dart'
]
constructor
:
'
raw'
inClass
:
'
ThemeData'
changes
:
-
kind
:
'
removeParameter'
name
:
'
primaryColorBrightness'
# Changes made in https://github.com/flutter/flutter/pull/93396
-
title
:
"
Remove
'primaryColorBrightness'"
date
:
2021-11-11
element
:
uris
:
[
'
material.dart'
]
constructor
:
'
'
inClass
:
'
ThemeData'
changes
:
-
kind
:
'
removeParameter'
name
:
'
primaryColorBrightness'
# Changes made in https://github.com/flutter/flutter/pull/86198
# Changes made in https://github.com/flutter/flutter/pull/86198
-
title
:
"
Migrate
to
'backgroundColor'"
-
title
:
"
Migrate
to
'backgroundColor'"
...
...
packages/flutter/lib/src/material/app_bar.dart
View file @
e1a96b81
...
@@ -1047,7 +1047,7 @@ class _AppBarState extends State<AppBar> {
...
@@ -1047,7 +1047,7 @@ class _AppBarState extends State<AppBar> {
?
_systemOverlayStyleForBrightness
(
?
_systemOverlayStyleForBrightness
(
widget
.
brightness
widget
.
brightness
??
appBarTheme
.
brightness
??
appBarTheme
.
brightness
??
theme
.
primaryColorBrightness
,
??
ThemeData
.
estimateBrightnessForColor
(
backgroundColor
)
,
)
)
:
widget
.
systemOverlayStyle
:
widget
.
systemOverlayStyle
??
appBarTheme
.
systemOverlayStyle
??
appBarTheme
.
systemOverlayStyle
...
...
packages/flutter/lib/src/material/text_field.dart
View file @
e1a96b81
...
@@ -662,7 +662,7 @@ class TextField extends StatefulWidget {
...
@@ -662,7 +662,7 @@ class TextField extends StatefulWidget {
///
///
/// This setting is only honored on iOS devices.
/// This setting is only honored on iOS devices.
///
///
/// If unset, defaults to
the brightness of [ThemeData.primaryColorB
rightness].
/// If unset, defaults to
[ThemeData.b
rightness].
final
Brightness
?
keyboardAppearance
;
final
Brightness
?
keyboardAppearance
;
/// {@macro flutter.widgets.editableText.scrollPadding}
/// {@macro flutter.widgets.editableText.scrollPadding}
...
@@ -1143,7 +1143,7 @@ class _TextFieldState extends State<TextField> with RestorationMixin implements
...
@@ -1143,7 +1143,7 @@ class _TextFieldState extends State<TextField> with RestorationMixin implements
final
ThemeData
theme
=
Theme
.
of
(
context
);
final
ThemeData
theme
=
Theme
.
of
(
context
);
final
TextSelectionThemeData
selectionTheme
=
TextSelectionTheme
.
of
(
context
);
final
TextSelectionThemeData
selectionTheme
=
TextSelectionTheme
.
of
(
context
);
final
TextStyle
style
=
theme
.
textTheme
.
subtitle1
!.
merge
(
widget
.
style
);
final
TextStyle
style
=
theme
.
textTheme
.
subtitle1
!.
merge
(
widget
.
style
);
final
Brightness
keyboardAppearance
=
widget
.
keyboardAppearance
??
theme
.
primaryColorB
rightness
;
final
Brightness
keyboardAppearance
=
widget
.
keyboardAppearance
??
theme
.
b
rightness
;
final
TextEditingController
controller
=
_effectiveController
;
final
TextEditingController
controller
=
_effectiveController
;
final
FocusNode
focusNode
=
_effectiveFocusNode
;
final
FocusNode
focusNode
=
_effectiveFocusNode
;
final
List
<
TextInputFormatter
>
formatters
=
<
TextInputFormatter
>[
final
List
<
TextInputFormatter
>
formatters
=
<
TextInputFormatter
>[
...
...
packages/flutter/lib/src/material/theme_data.dart
View file @
e1a96b81
...
@@ -239,7 +239,6 @@ class ThemeData with Diagnosticable {
...
@@ -239,7 +239,6 @@ class ThemeData with Diagnosticable {
Brightness
?
brightness
,
Brightness
?
brightness
,
MaterialColor
?
primarySwatch
,
MaterialColor
?
primarySwatch
,
Color
?
primaryColor
,
Color
?
primaryColor
,
Brightness
?
primaryColorBrightness
,
Color
?
primaryColorLight
,
Color
?
primaryColorLight
,
Color
?
primaryColorDark
,
Color
?
primaryColorDark
,
Color
?
focusColor
,
Color
?
focusColor
,
...
@@ -361,6 +360,11 @@ class ThemeData with Diagnosticable {
...
@@ -361,6 +360,11 @@ class ThemeData with Diagnosticable {
'This feature was deprecated after v2.5.0-1.0.pre.'
,
'This feature was deprecated after v2.5.0-1.0.pre.'
,
)
)
bool
?
fixTextFieldOutlineLabel
,
bool
?
fixTextFieldOutlineLabel
,
@Deprecated
(
'No longer used by the framework, please remove any reference to it. '
'This feature was deprecated after v2.6.0-11.0.pre.'
,
)
Brightness
?
primaryColorBrightness
,
})
{
})
{
// GENERAL CONFIGURATION
// GENERAL CONFIGURATION
applyElevationOverlayColor
??=
false
;
applyElevationOverlayColor
??=
false
;
...
@@ -390,10 +394,10 @@ class ThemeData with Diagnosticable {
...
@@ -390,10 +394,10 @@ class ThemeData with Diagnosticable {
final
bool
isDark
=
_brightness
==
Brightness
.
dark
;
final
bool
isDark
=
_brightness
==
Brightness
.
dark
;
primarySwatch
??=
Colors
.
blue
;
primarySwatch
??=
Colors
.
blue
;
primaryColor
??=
isDark
?
Colors
.
grey
[
900
]!
:
primarySwatch
;
primaryColor
??=
isDark
?
Colors
.
grey
[
900
]!
:
primarySwatch
;
primaryColorBrightness
??
=
estimateBrightnessForColor
(
primaryColor
);
final
Brightness
_primaryColorBrightness
=
estimateBrightnessForColor
(
primaryColor
);
primaryColorLight
??=
isDark
?
Colors
.
grey
[
500
]!
:
primarySwatch
[
100
]!;
primaryColorLight
??=
isDark
?
Colors
.
grey
[
500
]!
:
primarySwatch
[
100
]!;
primaryColorDark
??=
isDark
?
Colors
.
black
:
primarySwatch
[
700
]!;
primaryColorDark
??=
isDark
?
Colors
.
black
:
primarySwatch
[
700
]!;
final
bool
primaryIsDark
=
primaryColorBrightness
==
Brightness
.
dark
;
final
bool
primaryIsDark
=
_
primaryColorBrightness
==
Brightness
.
dark
;
toggleableActiveColor
??=
isDark
?
Colors
.
tealAccent
[
200
]!
:
(
accentColor
??
primarySwatch
[
600
]!);
toggleableActiveColor
??=
isDark
?
Colors
.
tealAccent
[
200
]!
:
(
accentColor
??
primarySwatch
[
600
]!);
accentColor
??=
isDark
?
Colors
.
tealAccent
[
200
]!
:
primarySwatch
[
500
]!;
accentColor
??=
isDark
?
Colors
.
tealAccent
[
200
]!
:
primarySwatch
[
500
]!;
accentColorBrightness
??=
estimateBrightnessForColor
(
accentColor
);
accentColorBrightness
??=
estimateBrightnessForColor
(
accentColor
);
...
@@ -500,6 +504,7 @@ class ThemeData with Diagnosticable {
...
@@ -500,6 +504,7 @@ class ThemeData with Diagnosticable {
accentIconTheme
??=
accentIsDark
?
const
IconThemeData
(
color:
Colors
.
white
)
:
const
IconThemeData
(
color:
Colors
.
black
);
accentIconTheme
??=
accentIsDark
?
const
IconThemeData
(
color:
Colors
.
white
)
:
const
IconThemeData
(
color:
Colors
.
black
);
buttonColor
??=
isDark
?
primarySwatch
[
600
]!
:
Colors
.
grey
[
300
]!;
buttonColor
??=
isDark
?
primarySwatch
[
600
]!
:
Colors
.
grey
[
300
]!;
fixTextFieldOutlineLabel
??=
true
;
fixTextFieldOutlineLabel
??=
true
;
primaryColorBrightness
=
_primaryColorBrightness
;
return
ThemeData
.
raw
(
return
ThemeData
.
raw
(
// GENERAL CONFIGURATION
// GENERAL CONFIGURATION
...
@@ -516,7 +521,6 @@ class ThemeData with Diagnosticable {
...
@@ -516,7 +521,6 @@ class ThemeData with Diagnosticable {
// COLOR
// COLOR
colorScheme:
colorScheme
,
colorScheme:
colorScheme
,
primaryColor:
primaryColor
,
primaryColor:
primaryColor
,
primaryColorBrightness:
primaryColorBrightness
,
primaryColorLight:
primaryColorLight
,
primaryColorLight:
primaryColorLight
,
primaryColorDark:
primaryColorDark
,
primaryColorDark:
primaryColorDark
,
focusColor:
focusColor
,
focusColor:
focusColor
,
...
@@ -589,6 +593,7 @@ class ThemeData with Diagnosticable {
...
@@ -589,6 +593,7 @@ class ThemeData with Diagnosticable {
accentIconTheme:
accentIconTheme
,
accentIconTheme:
accentIconTheme
,
buttonColor:
buttonColor
,
buttonColor:
buttonColor
,
fixTextFieldOutlineLabel:
fixTextFieldOutlineLabel
,
fixTextFieldOutlineLabel:
fixTextFieldOutlineLabel
,
primaryColorBrightness:
primaryColorBrightness
,
);
);
}
}
...
@@ -620,7 +625,6 @@ class ThemeData with Diagnosticable {
...
@@ -620,7 +625,6 @@ class ThemeData with Diagnosticable {
// https://github.com/flutter/flutter/issues/91772.
// https://github.com/flutter/flutter/issues/91772.
required
this
.
colorScheme
,
required
this
.
colorScheme
,
required
this
.
primaryColor
,
required
this
.
primaryColor
,
required
this
.
primaryColorBrightness
,
required
this
.
primaryColorLight
,
required
this
.
primaryColorLight
,
required
this
.
primaryColorDark
,
required
this
.
primaryColorDark
,
required
this
.
focusColor
,
required
this
.
focusColor
,
...
@@ -741,6 +745,11 @@ class ThemeData with Diagnosticable {
...
@@ -741,6 +745,11 @@ class ThemeData with Diagnosticable {
'This feature was deprecated after v2.5.0-1.0.pre.'
,
'This feature was deprecated after v2.5.0-1.0.pre.'
,
)
)
required
this
.
fixTextFieldOutlineLabel
,
required
this
.
fixTextFieldOutlineLabel
,
@Deprecated
(
'No longer used by the framework, please remove any reference to it. '
'This feature was deprecated after v2.6.0-11.0.pre.'
,
)
required
this
.
primaryColorBrightness
,
})
:
// GENERAL CONFIGURATION
})
:
// GENERAL CONFIGURATION
assert
(
applyElevationOverlayColor
!=
null
),
assert
(
applyElevationOverlayColor
!=
null
),
assert
(
inputDecorationTheme
!=
null
),
assert
(
inputDecorationTheme
!=
null
),
...
@@ -753,7 +762,6 @@ class ThemeData with Diagnosticable {
...
@@ -753,7 +762,6 @@ class ThemeData with Diagnosticable {
// COLOR
// COLOR
assert
(
colorScheme
!=
null
),
assert
(
colorScheme
!=
null
),
assert
(
primaryColor
!=
null
),
assert
(
primaryColor
!=
null
),
assert
(
primaryColorBrightness
!=
null
),
assert
(
primaryColorLight
!=
null
),
assert
(
primaryColorLight
!=
null
),
assert
(
primaryColorDark
!=
null
),
assert
(
primaryColorDark
!=
null
),
assert
(
focusColor
!=
null
),
assert
(
focusColor
!=
null
),
...
@@ -825,7 +833,8 @@ class ThemeData with Diagnosticable {
...
@@ -825,7 +833,8 @@ class ThemeData with Diagnosticable {
assert
(
accentTextTheme
!=
null
),
assert
(
accentTextTheme
!=
null
),
assert
(
accentIconTheme
!=
null
),
assert
(
accentIconTheme
!=
null
),
assert
(
buttonColor
!=
null
),
assert
(
buttonColor
!=
null
),
assert
(
fixTextFieldOutlineLabel
!=
null
);
assert
(
fixTextFieldOutlineLabel
!=
null
),
assert
(
primaryColorBrightness
!=
null
);
/// Create a [ThemeData] based on the colors in the given [colorScheme] and
/// Create a [ThemeData] based on the colors in the given [colorScheme] and
/// text styles of the optional [textTheme].
/// text styles of the optional [textTheme].
...
@@ -1089,10 +1098,6 @@ class ThemeData with Diagnosticable {
...
@@ -1089,10 +1098,6 @@ class ThemeData with Diagnosticable {
/// visuals in terms of the theme's [colorScheme].
/// visuals in terms of the theme's [colorScheme].
final
Color
primaryColor
;
final
Color
primaryColor
;
/// The brightness of the [primaryColor]. Used to determine the color of text and
/// icons placed on top of the primary color (e.g. toolbar text).
final
Brightness
primaryColorBrightness
;
/// A lighter version of the [primaryColor].
/// A lighter version of the [primaryColor].
final
Color
primaryColorLight
;
final
Color
primaryColorLight
;
...
@@ -1451,6 +1456,21 @@ class ThemeData with Diagnosticable {
...
@@ -1451,6 +1456,21 @@ class ThemeData with Diagnosticable {
)
)
final
bool
fixTextFieldOutlineLabel
;
final
bool
fixTextFieldOutlineLabel
;
/// Obsolete property that was originally used to determine the color
/// of text and icons placed on top of the primary color (e.g. toolbar text).
///
/// The material library no longer uses this property. The [appBarTheme] can
/// be used to configure the appearance of [AppBar]s. The appearance of
/// Keyboards for [TextField]s now uses the overall theme's
/// [ThemeData.brightness] and can also be customized with
/// [TextField.keyboardAppearance]. The brightness of any color can be found
/// with [ThemeData.estimateBrightnessForColor].
@Deprecated
(
'No longer used by the framework, please remove any reference to it. '
'This feature was deprecated after v2.6.0-11.0.pre.'
,
)
final
Brightness
primaryColorBrightness
;
/// Creates a copy of this theme but with the given fields replaced with the new values.
/// Creates a copy of this theme but with the given fields replaced with the new values.
///
///
/// The [brightness] value is applied to the [colorScheme].
/// The [brightness] value is applied to the [colorScheme].
...
@@ -1473,7 +1493,6 @@ class ThemeData with Diagnosticable {
...
@@ -1473,7 +1493,6 @@ class ThemeData with Diagnosticable {
ColorScheme
?
colorScheme
,
ColorScheme
?
colorScheme
,
Brightness
?
brightness
,
Brightness
?
brightness
,
Color
?
primaryColor
,
Color
?
primaryColor
,
Brightness
?
primaryColorBrightness
,
Color
?
primaryColorLight
,
Color
?
primaryColorLight
,
Color
?
primaryColorDark
,
Color
?
primaryColorDark
,
Color
?
focusColor
,
Color
?
focusColor
,
...
@@ -1594,6 +1613,11 @@ class ThemeData with Diagnosticable {
...
@@ -1594,6 +1613,11 @@ class ThemeData with Diagnosticable {
'This feature was deprecated after v2.5.0-1.0.pre.'
,
'This feature was deprecated after v2.5.0-1.0.pre.'
,
)
)
bool
?
fixTextFieldOutlineLabel
,
bool
?
fixTextFieldOutlineLabel
,
@Deprecated
(
'No longer used by the framework, please remove any reference to it. '
'This feature was deprecated after v2.6.0-11.0.pre.'
,
)
Brightness
?
primaryColorBrightness
,
})
{
})
{
cupertinoOverrideTheme
=
cupertinoOverrideTheme
?.
noDefault
();
cupertinoOverrideTheme
=
cupertinoOverrideTheme
?.
noDefault
();
return
ThemeData
.
raw
(
return
ThemeData
.
raw
(
...
@@ -1611,7 +1635,6 @@ class ThemeData with Diagnosticable {
...
@@ -1611,7 +1635,6 @@ class ThemeData with Diagnosticable {
// COLOR
// COLOR
colorScheme:
(
colorScheme
??
this
.
colorScheme
).
copyWith
(
brightness:
brightness
),
colorScheme:
(
colorScheme
??
this
.
colorScheme
).
copyWith
(
brightness:
brightness
),
primaryColor:
primaryColor
??
this
.
primaryColor
,
primaryColor:
primaryColor
??
this
.
primaryColor
,
primaryColorBrightness:
primaryColorBrightness
??
this
.
primaryColorBrightness
,
primaryColorLight:
primaryColorLight
??
this
.
primaryColorLight
,
primaryColorLight:
primaryColorLight
??
this
.
primaryColorLight
,
primaryColorDark:
primaryColorDark
??
this
.
primaryColorDark
,
primaryColorDark:
primaryColorDark
??
this
.
primaryColorDark
,
focusColor:
focusColor
??
this
.
focusColor
,
focusColor:
focusColor
??
this
.
focusColor
,
...
@@ -1684,6 +1707,7 @@ class ThemeData with Diagnosticable {
...
@@ -1684,6 +1707,7 @@ class ThemeData with Diagnosticable {
accentIconTheme:
accentIconTheme
??
this
.
accentIconTheme
,
accentIconTheme:
accentIconTheme
??
this
.
accentIconTheme
,
buttonColor:
buttonColor
??
this
.
buttonColor
,
buttonColor:
buttonColor
??
this
.
buttonColor
,
fixTextFieldOutlineLabel:
fixTextFieldOutlineLabel
??
this
.
fixTextFieldOutlineLabel
,
fixTextFieldOutlineLabel:
fixTextFieldOutlineLabel
??
this
.
fixTextFieldOutlineLabel
,
primaryColorBrightness:
primaryColorBrightness
??
this
.
primaryColorBrightness
,
);
);
}
}
...
@@ -1779,7 +1803,6 @@ class ThemeData with Diagnosticable {
...
@@ -1779,7 +1803,6 @@ class ThemeData with Diagnosticable {
// COLOR
// COLOR
colorScheme:
ColorScheme
.
lerp
(
a
.
colorScheme
,
b
.
colorScheme
,
t
),
colorScheme:
ColorScheme
.
lerp
(
a
.
colorScheme
,
b
.
colorScheme
,
t
),
primaryColor:
Color
.
lerp
(
a
.
primaryColor
,
b
.
primaryColor
,
t
)!,
primaryColor:
Color
.
lerp
(
a
.
primaryColor
,
b
.
primaryColor
,
t
)!,
primaryColorBrightness:
t
<
0.5
?
a
.
primaryColorBrightness
:
b
.
primaryColorBrightness
,
primaryColorLight:
Color
.
lerp
(
a
.
primaryColorLight
,
b
.
primaryColorLight
,
t
)!,
primaryColorLight:
Color
.
lerp
(
a
.
primaryColorLight
,
b
.
primaryColorLight
,
t
)!,
primaryColorDark:
Color
.
lerp
(
a
.
primaryColorDark
,
b
.
primaryColorDark
,
t
)!,
primaryColorDark:
Color
.
lerp
(
a
.
primaryColorDark
,
b
.
primaryColorDark
,
t
)!,
focusColor:
Color
.
lerp
(
a
.
focusColor
,
b
.
focusColor
,
t
)!,
focusColor:
Color
.
lerp
(
a
.
focusColor
,
b
.
focusColor
,
t
)!,
...
@@ -1852,6 +1875,7 @@ class ThemeData with Diagnosticable {
...
@@ -1852,6 +1875,7 @@ class ThemeData with Diagnosticable {
accentIconTheme:
IconThemeData
.
lerp
(
a
.
accentIconTheme
,
b
.
accentIconTheme
,
t
),
accentIconTheme:
IconThemeData
.
lerp
(
a
.
accentIconTheme
,
b
.
accentIconTheme
,
t
),
buttonColor:
Color
.
lerp
(
a
.
buttonColor
,
b
.
buttonColor
,
t
)!,
buttonColor:
Color
.
lerp
(
a
.
buttonColor
,
b
.
buttonColor
,
t
)!,
fixTextFieldOutlineLabel:
t
<
0.5
?
a
.
fixTextFieldOutlineLabel
:
b
.
fixTextFieldOutlineLabel
,
fixTextFieldOutlineLabel:
t
<
0.5
?
a
.
fixTextFieldOutlineLabel
:
b
.
fixTextFieldOutlineLabel
,
primaryColorBrightness:
t
<
0.5
?
a
.
primaryColorBrightness
:
b
.
primaryColorBrightness
,
);
);
}
}
...
@@ -1877,7 +1901,6 @@ class ThemeData with Diagnosticable {
...
@@ -1877,7 +1901,6 @@ class ThemeData with Diagnosticable {
// COLOR
// COLOR
other
.
colorScheme
==
colorScheme
&&
other
.
colorScheme
==
colorScheme
&&
other
.
primaryColor
==
primaryColor
&&
other
.
primaryColor
==
primaryColor
&&
other
.
primaryColorBrightness
==
primaryColorBrightness
&&
other
.
primaryColorLight
==
primaryColorLight
&&
other
.
primaryColorLight
==
primaryColorLight
&&
other
.
primaryColorDark
==
primaryColorDark
&&
other
.
primaryColorDark
==
primaryColorDark
&&
other
.
focusColor
==
focusColor
&&
other
.
focusColor
==
focusColor
&&
...
@@ -1949,7 +1972,8 @@ class ThemeData with Diagnosticable {
...
@@ -1949,7 +1972,8 @@ class ThemeData with Diagnosticable {
other
.
accentTextTheme
==
accentTextTheme
&&
other
.
accentTextTheme
==
accentTextTheme
&&
other
.
accentIconTheme
==
accentIconTheme
&&
other
.
accentIconTheme
==
accentIconTheme
&&
other
.
buttonColor
==
buttonColor
&&
other
.
buttonColor
==
buttonColor
&&
other
.
fixTextFieldOutlineLabel
==
fixTextFieldOutlineLabel
;
other
.
fixTextFieldOutlineLabel
==
fixTextFieldOutlineLabel
&&
other
.
primaryColorBrightness
==
primaryColorBrightness
;
}
}
@override
@override
...
@@ -1972,7 +1996,6 @@ class ThemeData with Diagnosticable {
...
@@ -1972,7 +1996,6 @@ class ThemeData with Diagnosticable {
// COLOR
// COLOR
colorScheme
,
colorScheme
,
primaryColor
,
primaryColor
,
primaryColorBrightness
,
primaryColorLight
,
primaryColorLight
,
primaryColorDark
,
primaryColorDark
,
focusColor
,
focusColor
,
...
@@ -2045,6 +2068,7 @@ class ThemeData with Diagnosticable {
...
@@ -2045,6 +2068,7 @@ class ThemeData with Diagnosticable {
accentIconTheme
,
accentIconTheme
,
buttonColor
,
buttonColor
,
fixTextFieldOutlineLabel
,
fixTextFieldOutlineLabel
,
primaryColorBrightness
,
];
];
return
hashList
(
values
);
return
hashList
(
values
);
}
}
...
@@ -2067,7 +2091,6 @@ class ThemeData with Diagnosticable {
...
@@ -2067,7 +2091,6 @@ class ThemeData with Diagnosticable {
// COLORS
// COLORS
properties
.
add
(
DiagnosticsProperty
<
ColorScheme
>(
'colorScheme'
,
colorScheme
,
defaultValue:
defaultData
.
colorScheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
ColorScheme
>(
'colorScheme'
,
colorScheme
,
defaultValue:
defaultData
.
colorScheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'primaryColor'
,
primaryColor
,
defaultValue:
defaultData
.
primaryColor
,
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
(
'primaryColorLight'
,
primaryColorLight
,
defaultValue:
defaultData
.
primaryColorLight
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'primaryColorLight'
,
primaryColorLight
,
defaultValue:
defaultData
.
primaryColorLight
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'primaryColorDark'
,
primaryColorDark
,
defaultValue:
defaultData
.
primaryColorDark
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'primaryColorDark'
,
primaryColorDark
,
defaultValue:
defaultData
.
primaryColorDark
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'focusColor'
,
focusColor
,
defaultValue:
defaultData
.
focusColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'focusColor'
,
focusColor
,
defaultValue:
defaultData
.
focusColor
,
level:
DiagnosticLevel
.
debug
));
...
@@ -2140,6 +2163,7 @@ class ThemeData with Diagnosticable {
...
@@ -2140,6 +2163,7 @@ class ThemeData with Diagnosticable {
properties
.
add
(
DiagnosticsProperty
<
IconThemeData
>(
'accentIconTheme'
,
accentIconTheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
IconThemeData
>(
'accentIconTheme'
,
accentIconTheme
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'buttonColor'
,
buttonColor
,
defaultValue:
defaultData
.
buttonColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
ColorProperty
(
'buttonColor'
,
buttonColor
,
defaultValue:
defaultData
.
buttonColor
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
bool
>(
'fixTextFieldOutlineLabel'
,
fixTextFieldOutlineLabel
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
DiagnosticsProperty
<
bool
>(
'fixTextFieldOutlineLabel'
,
fixTextFieldOutlineLabel
,
level:
DiagnosticLevel
.
debug
));
properties
.
add
(
EnumProperty
<
Brightness
>(
'primaryColorBrightness'
,
primaryColorBrightness
,
defaultValue:
defaultData
.
primaryColorBrightness
,
level:
DiagnosticLevel
.
debug
));
}
}
}
}
...
...
packages/flutter/test/material/circle_avatar_test.dart
View file @
e1a96b81
...
@@ -5,7 +5,6 @@
...
@@ -5,7 +5,6 @@
// This file is run as part of a reduced test set in CI on Mac and Windows
// This file is run as part of a reduced test set in CI on Mac and Windows
// machines.
// machines.
@Tags
(<
String
>[
'reduced-test-set'
])
@Tags
(<
String
>[
'reduced-test-set'
])
import
'dart:typed_data'
;
import
'dart:typed_data'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
...
...
packages/flutter/test/material/theme_data_test.dart
View file @
e1a96b81
...
@@ -43,8 +43,8 @@ void main() {
...
@@ -43,8 +43,8 @@ void main() {
});
});
test
(
'Default primary text theme contrasts with primary brightness'
,
()
{
test
(
'Default primary text theme contrasts with primary brightness'
,
()
{
final
ThemeData
lightTheme
=
ThemeData
(
primaryColor
Brightness:
Brightness
.
light
);
final
ThemeData
lightTheme
=
ThemeData
(
primaryColor
:
Colors
.
white
);
final
ThemeData
darkTheme
=
ThemeData
(
primaryColor
Brightness:
Brightness
.
dar
k
);
final
ThemeData
darkTheme
=
ThemeData
(
primaryColor
:
Colors
.
blac
k
);
final
Typography
typography
=
Typography
.
material2018
(
platform:
lightTheme
.
platform
);
final
Typography
typography
=
Typography
.
material2018
(
platform:
lightTheme
.
platform
);
expect
(
lightTheme
.
primaryTextTheme
.
headline6
!.
color
,
typography
.
black
.
headline6
!.
color
);
expect
(
lightTheme
.
primaryTextTheme
.
headline6
!.
color
,
typography
.
black
.
headline6
!.
color
);
...
@@ -61,8 +61,8 @@ void main() {
...
@@ -61,8 +61,8 @@ void main() {
});
});
test
(
'Default primary icon theme contrasts with primary brightness'
,
()
{
test
(
'Default primary icon theme contrasts with primary brightness'
,
()
{
final
ThemeData
lightTheme
=
ThemeData
(
primaryColor
Brightness:
Brightness
.
light
);
final
ThemeData
lightTheme
=
ThemeData
(
primaryColor
:
Colors
.
white
);
final
ThemeData
darkTheme
=
ThemeData
(
primaryColor
Brightness:
Brightness
.
dar
k
);
final
ThemeData
darkTheme
=
ThemeData
(
primaryColor
:
Colors
.
blac
k
);
final
Typography
typography
=
Typography
.
material2018
(
platform:
lightTheme
.
platform
);
final
Typography
typography
=
Typography
.
material2018
(
platform:
lightTheme
.
platform
);
expect
(
lightTheme
.
primaryTextTheme
.
headline6
!.
color
,
typography
.
black
.
headline6
!.
color
);
expect
(
lightTheme
.
primaryTextTheme
.
headline6
!.
color
,
typography
.
black
.
headline6
!.
color
);
...
@@ -670,7 +670,6 @@ void main() {
...
@@ -670,7 +670,6 @@ void main() {
// COLOR
// COLOR
'colorScheme'
,
'colorScheme'
,
'primaryColor'
,
'primaryColor'
,
'primaryColorBrightness'
,
'primaryColorLight'
,
'primaryColorLight'
,
'primaryColorDark'
,
'primaryColorDark'
,
'focusColor'
,
'focusColor'
,
...
@@ -743,6 +742,7 @@ void main() {
...
@@ -743,6 +742,7 @@ void main() {
'accentIconTheme'
,
'accentIconTheme'
,
'buttonColor'
,
'buttonColor'
,
'fixTextFieldOutlineLabel'
,
'fixTextFieldOutlineLabel'
,
'primaryColorBrightness'
,
};
};
final
DiagnosticPropertiesBuilder
properties
=
DiagnosticPropertiesBuilder
();
final
DiagnosticPropertiesBuilder
properties
=
DiagnosticPropertiesBuilder
();
...
...
packages/flutter/test_fixes/material.dart
View file @
e1a96b81
...
@@ -500,4 +500,11 @@ void main() {
...
@@ -500,4 +500,11 @@ void main() {
AppBarTheme
appBarTheme
=
AppBarTheme
();
AppBarTheme
appBarTheme
=
AppBarTheme
();
appBarTheme
.
color
;
appBarTheme
.
color
;
// Changes made in https://github.com/flutter/flutter/pull/93396
ThemeData
themeData
=
ThemeData
();
themeData
=
ThemeData
(
primaryColorBrightness:
Brightness
.
dark
);
themeData
=
ThemeData
.
raw
(
primaryColorBrightness:
Brightness
.
dark
);
themeData
=
themeData
.
copyWith
(
primaryColorBrightness:
Brightness
.
dark
);
themeData
.
primaryColorBrightness
;
// Removing field reference not supported.
}
}
packages/flutter/test_fixes/material.dart.expect
View file @
e1a96b81
...
@@ -473,4 +473,11 @@ void main() {
...
@@ -473,4 +473,11 @@ void main() {
AppBarTheme appBarTheme = AppBarTheme();
AppBarTheme appBarTheme = AppBarTheme();
appBarTheme.backgroundColor;
appBarTheme.backgroundColor;
// Changes made in https://github.com/flutter/flutter/pull/93396
ThemeData themeData = ThemeData();
themeData = ThemeData();
themeData = ThemeData.raw();
themeData = themeData.copyWith();
themeData.primaryColorBrightness; // Removing field reference not supported.
}
}
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