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
31668eef
Unverified
Commit
31668eef
authored
Apr 07, 2022
by
Taha Tesser
Committed by
GitHub
Apr 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix `DrawerHeader` decoration not inheriting `ColorScheme.primary` (#101280)
parent
d103e5a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
user_accounts_drawer_header.dart
...flutter/lib/src/material/user_accounts_drawer_header.dart
+1
-3
user_accounts_drawer_header_test.dart
...utter/test/material/user_accounts_drawer_header_test.dart
+19
-0
No files found.
packages/flutter/lib/src/material/user_accounts_drawer_header.dart
View file @
31668eef
...
...
@@ -369,9 +369,7 @@ class _UserAccountsDrawerHeaderState extends State<UserAccountsDrawerHeader> {
container:
true
,
label:
MaterialLocalizations
.
of
(
context
).
signedInLabel
,
child:
DrawerHeader
(
decoration:
widget
.
decoration
??
BoxDecoration
(
color:
Theme
.
of
(
context
).
primaryColor
,
),
decoration:
widget
.
decoration
??
BoxDecoration
(
color:
Theme
.
of
(
context
).
colorScheme
.
primary
),
margin:
widget
.
margin
,
padding:
const
EdgeInsetsDirectional
.
only
(
top:
16.0
,
start:
16.0
),
child:
SafeArea
(
...
...
packages/flutter/test/material/user_accounts_drawer_header_test.dart
View file @
31668eef
...
...
@@ -19,9 +19,15 @@ Future<void> pumpTestWidget(
bool
withOnDetailsPressedHandler
=
true
,
Size
otherAccountsPictureSize
=
const
Size
.
square
(
40.0
),
Size
currentAccountPictureSize
=
const
Size
.
square
(
72.0
),
Color
?
primaryColor
,
Color
?
colorSchemePrimary
,
})
async
{
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(
primaryColor:
primaryColor
,
colorScheme:
const
ColorScheme
.
light
().
copyWith
(
primary:
colorSchemePrimary
),
),
home:
MediaQuery
(
data:
const
MediaQueryData
(
padding:
EdgeInsets
.
only
(
...
...
@@ -76,6 +82,19 @@ void main() {
matching:
find
.
byType
(
Transform
),
);
testWidgets
(
'UserAccountsDrawerHeader inherits ColorScheme.primary'
,
(
WidgetTester
tester
)
async
{
const
Color
primaryColor
=
Color
(
0xff00ff00
);
const
Color
colorSchemePrimary
=
Color
(
0xff0000ff
);
await
pumpTestWidget
(
tester
,
primaryColor:
primaryColor
,
colorSchemePrimary:
colorSchemePrimary
);
final
BoxDecoration
?
boxDecoration
=
tester
.
widget
<
DrawerHeader
>(
find
.
byType
(
DrawerHeader
),
).
decoration
as
BoxDecoration
?;
expect
(
boxDecoration
?.
color
==
primaryColor
,
false
);
expect
(
boxDecoration
?.
color
==
colorSchemePrimary
,
true
);
});
testWidgets
(
'UserAccountsDrawerHeader test'
,
(
WidgetTester
tester
)
async
{
await
pumpTestWidget
(
tester
);
...
...
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