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
064a9e57
Unverified
Commit
064a9e57
authored
Jul 28, 2020
by
Rami
Committed by
GitHub
Jul 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure banner reads banner theme's leading padding property (#62195)
parent
00dcd5f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
banner.dart
packages/flutter/lib/src/material/banner.dart
+1
-1
banner_theme_test.dart
packages/flutter/test/material/banner_theme_test.dart
+6
-6
No files found.
packages/flutter/lib/src/material/banner.dart
View file @
064a9e57
...
...
@@ -117,7 +117,7 @@ class MaterialBanner extends StatelessWidget {
?
const
EdgeInsetsDirectional
.
only
(
start:
16.0
,
top:
2.0
)
:
const
EdgeInsetsDirectional
.
only
(
start:
16.0
,
top:
24.0
,
end:
16.0
,
bottom:
4.0
));
final
EdgeInsetsGeometry
leadingPadding
=
this
.
leadingPadding
??
bannerTheme
.
p
adding
??
bannerTheme
.
leadingP
adding
??
const
EdgeInsetsDirectional
.
only
(
end:
16.0
);
final
Widget
buttonBar
=
ButtonBar
(
...
...
packages/flutter/test/material/banner_theme_test.dart
View file @
064a9e57
...
...
@@ -101,9 +101,9 @@ void main() {
final
Offset
containerTopLeft
=
tester
.
getTopLeft
(
_containerFinder
());
final
Offset
leadingTopLeft
=
tester
.
getTopLeft
(
find
.
byIcon
(
Icons
.
ac_unit
));
expect
(
contentTopLeft
.
dy
-
containerTopLeft
.
dy
,
24
);
expect
(
contentTopLeft
.
dx
-
containerTopLeft
.
dx
,
39
);
expect
(
contentTopLeft
.
dx
-
containerTopLeft
.
dx
,
41
);
expect
(
leadingTopLeft
.
dy
-
containerTopLeft
.
dy
,
19
);
expect
(
leadingTopLeft
.
dx
-
containerTopLeft
.
dx
,
1
0
);
expect
(
leadingTopLeft
.
dx
-
containerTopLeft
.
dx
,
1
1
);
});
testWidgets
(
'MaterialBanner widget properties take priority over theme'
,
(
WidgetTester
tester
)
async
{
...
...
@@ -120,7 +120,7 @@ void main() {
contentTextStyle:
textStyle
,
content:
const
Text
(
contentText
),
padding:
const
EdgeInsets
.
all
(
10
),
leadingPadding:
const
EdgeInsets
.
all
(
1
0
),
leadingPadding:
const
EdgeInsets
.
all
(
1
2
),
actions:
<
Widget
>[
TextButton
(
child:
const
Text
(
'Action'
),
...
...
@@ -140,9 +140,9 @@ void main() {
final
Offset
containerTopLeft
=
tester
.
getTopLeft
(
_containerFinder
());
final
Offset
leadingTopLeft
=
tester
.
getTopLeft
(
find
.
byIcon
(
Icons
.
ac_unit
));
expect
(
contentTopLeft
.
dy
-
containerTopLeft
.
dy
,
29
);
expect
(
contentTopLeft
.
dx
-
containerTopLeft
.
dx
,
5
4
);
expect
(
contentTopLeft
.
dx
-
containerTopLeft
.
dx
,
5
8
);
expect
(
leadingTopLeft
.
dy
-
containerTopLeft
.
dy
,
24
);
expect
(
leadingTopLeft
.
dx
-
containerTopLeft
.
dx
,
2
0
);
expect
(
leadingTopLeft
.
dx
-
containerTopLeft
.
dx
,
2
2
);
});
testWidgets
(
'MaterialBanner uses color scheme when necessary'
,
(
WidgetTester
tester
)
async
{
...
...
@@ -172,7 +172,7 @@ MaterialBannerThemeData _bannerTheme() {
backgroundColor:
Colors
.
orange
,
contentTextStyle:
TextStyle
(
color:
Colors
.
pink
),
padding:
EdgeInsets
.
all
(
5
),
leadingPadding:
EdgeInsets
.
all
(
5
),
leadingPadding:
EdgeInsets
.
all
(
6
),
);
}
...
...
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