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
ed0aed7d
Unverified
Commit
ed0aed7d
authored
Jan 15, 2021
by
Hans Muller
Committed by
GitHub
Jan 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed the color field from AppBarTheme (#73732)
parent
1b1ec738
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
14 deletions
+15
-14
app_bar_theme.dart
packages/flutter/lib/src/material/app_bar_theme.dart
+13
-12
app_bar_theme_test.dart
packages/flutter/test/material/app_bar_theme_test.dart
+2
-2
No files found.
packages/flutter/lib/src/material/app_bar_theme.dart
View file @
ed0aed7d
...
...
@@ -29,8 +29,8 @@ class AppBarTheme with Diagnosticable {
/// Creates a theme that can be used for [ThemeData.appBarTheme].
const
AppBarTheme
({
this
.
brightness
,
this
.
color
,
this
.
backgroundColor
,
Color
?
color
,
Color
?
backgroundColor
,
this
.
foregroundColor
,
this
.
elevation
,
this
.
shadowColor
,
...
...
@@ -43,7 +43,10 @@ class AppBarTheme with Diagnosticable {
this
.
titleTextStyle
,
this
.
systemOverlayStyle
,
this
.
backwardsCompatibility
,
});
})
:
assert
(
color
==
null
||
backgroundColor
==
null
,
'The color and backgroundColor parameters mean the same thing. Only specify one.'
),
backgroundColor
=
backgroundColor
??
color
;
/// This property is obsolete, please use [systemOverlayStyle] instead.
///
...
...
@@ -65,10 +68,11 @@ class AppBarTheme with Diagnosticable {
/// See also:
///
/// * [backgroundColor], which serves this same purpose
/// as this property, but has a consistent name.
/// as this property, but has a name that's consistent with
/// [AppBar.backgroundColor].
/// * [AppBar.backwardsCompatibility], which forces [AppBar] to depend
/// on this obsolete property.
final
Color
?
c
olor
;
Color
?
get
color
=>
backgroundC
olor
;
/// Overrides the default value of [AppBar.backgroundColor] in all
/// descendant [AppBar] widgets.
...
...
@@ -79,7 +83,6 @@ class AppBarTheme with Diagnosticable {
/// [AppBar.foregroundColor] in all descendant widgets.
final
Color
?
backgroundColor
;
/// Overrides the default value of [AppBar.foregroundColor] in all
/// descendant widgets.
///
...
...
@@ -185,10 +188,12 @@ class AppBarTheme with Diagnosticable {
SystemUiOverlayStyle
?
systemOverlayStyle
,
bool
?
backwardsCompatibility
,
})
{
assert
(
color
==
null
||
backgroundColor
==
null
,
'The color and backgroundColor parameters mean the same thing. Only specify one.'
);
return
AppBarTheme
(
brightness:
brightness
??
this
.
brightness
,
color:
color
??
this
.
color
,
backgroundColor:
backgroundColor
??
this
.
backgroundColor
,
backgroundColor:
backgroundColor
??
color
??
this
.
backgroundColor
,
foregroundColor:
foregroundColor
??
this
.
foregroundColor
,
elevation:
elevation
??
this
.
elevation
,
shadowColor:
shadowColor
??
this
.
shadowColor
,
...
...
@@ -218,7 +223,6 @@ class AppBarTheme with Diagnosticable {
assert
(
t
!=
null
);
return
AppBarTheme
(
brightness:
t
<
0.5
?
a
?.
brightness
:
b
?.
brightness
,
color:
Color
.
lerp
(
a
?.
color
,
b
?.
color
,
t
),
backgroundColor:
Color
.
lerp
(
a
?.
backgroundColor
,
b
?.
backgroundColor
,
t
),
foregroundColor:
Color
.
lerp
(
a
?.
foregroundColor
,
b
?.
foregroundColor
,
t
),
elevation:
lerpDouble
(
a
?.
elevation
,
b
?.
elevation
,
t
),
...
...
@@ -239,7 +243,6 @@ class AppBarTheme with Diagnosticable {
int
get
hashCode
{
return
hashValues
(
brightness
,
color
,
backgroundColor
,
foregroundColor
,
elevation
,
...
...
@@ -264,7 +267,6 @@ class AppBarTheme with Diagnosticable {
return
false
;
return
other
is
AppBarTheme
&&
other
.
brightness
==
brightness
&&
other
.
color
==
color
&&
other
.
backgroundColor
==
backgroundColor
&&
other
.
foregroundColor
==
foregroundColor
&&
other
.
elevation
==
elevation
...
...
@@ -284,7 +286,6 @@ class AppBarTheme with Diagnosticable {
void
debugFillProperties
(
DiagnosticPropertiesBuilder
properties
)
{
super
.
debugFillProperties
(
properties
);
properties
.
add
(
DiagnosticsProperty
<
Brightness
>(
'brightness'
,
brightness
,
defaultValue:
null
));
properties
.
add
(
ColorProperty
(
'color'
,
color
,
defaultValue:
null
));
properties
.
add
(
ColorProperty
(
'backgroundColor'
,
backgroundColor
,
defaultValue:
null
));
properties
.
add
(
ColorProperty
(
'foregroundColor'
,
foregroundColor
,
defaultValue:
null
));
properties
.
add
(
DiagnosticsProperty
<
double
>(
'elevation'
,
elevation
,
defaultValue:
null
));
...
...
packages/flutter/test/material/app_bar_theme_test.dart
View file @
ed0aed7d
...
...
@@ -442,7 +442,7 @@ void main() {
const
AppBarTheme
(
backwardsCompatibility:
false
,
brightness:
Brightness
.
dark
,
c
olor:
Color
(
0xff000001
),
backgroundC
olor:
Color
(
0xff000001
),
elevation:
8.0
,
shadowColor:
Color
(
0xff000002
),
centerTitle:
true
,
...
...
@@ -456,7 +456,7 @@ void main() {
expect
(
description
,
<
String
>[
'brightness: Brightness.dark'
,
'
c
olor: Color(0xff000001)'
,
'
backgroundC
olor: Color(0xff000001)'
,
'elevation: 8.0'
,
'shadowColor: Color(0xff000002)'
,
'centerTitle: true'
,
...
...
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