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
af9f2104
Unverified
Commit
af9f2104
authored
Sep 04, 2019
by
rami-a
Committed by
GitHub
Sep 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix single action banner to ensure button alignment (#39583)
parent
72cacb40
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
1 deletion
+46
-1
banner.dart
packages/flutter/lib/src/material/banner.dart
+1
-1
banner_test.dart
packages/flutter/test/material/banner_test.dart
+45
-0
No files found.
packages/flutter/lib/src/material/banner.dart
View file @
af9f2104
...
...
@@ -143,7 +143,7 @@ class MaterialBanner extends StatelessWidget {
padding:
leadingPadding
,
child:
leading
,
),
Flexible
(
Expanded
(
child:
DefaultTextStyle
(
style:
textStyle
,
child:
content
,
...
...
packages/flutter/test/material/banner_test.dart
View file @
af9f2104
...
...
@@ -100,6 +100,51 @@ void main() {
expect
(
contentBottomLeft
.
dx
,
lessThan
(
actionsTopRight
.
dx
));
});
// Regression test for https://github.com/flutter/flutter/issues/39574
testWidgets
(
'Single action laid out beside content but aligned to the trailing edge'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
MaterialApp
(
home:
MaterialBanner
(
content:
const
Text
(
'Content'
),
actions:
<
Widget
>[
FlatButton
(
child:
const
Text
(
'Action'
),
onPressed:
()
{
},
),
],
),
),
);
final
Offset
actionsTopRight
=
tester
.
getTopRight
(
find
.
byType
(
ButtonBar
));
final
Offset
bannerTopRight
=
tester
.
getTopRight
(
find
.
byType
(
MaterialBanner
));
expect
(
actionsTopRight
.
dx
,
bannerTopRight
.
dx
);
});
// Regression test for https://github.com/flutter/flutter/issues/39574
testWidgets
(
'Single action laid out beside content but aligned to the trailing edge - RTL'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Directionality
(
textDirection:
TextDirection
.
rtl
,
child:
MaterialBanner
(
content:
const
Text
(
'Content'
),
actions:
<
Widget
>[
FlatButton
(
child:
const
Text
(
'Action'
),
onPressed:
()
{
},
),
],
),
),
),
);
final
Offset
actionsTopLeft
=
tester
.
getTopLeft
(
find
.
byType
(
ButtonBar
));
final
Offset
bannerTopLeft
=
tester
.
getTopLeft
(
find
.
byType
(
MaterialBanner
));
expect
(
actionsTopLeft
.
dx
,
bannerTopLeft
.
dx
);
});
testWidgets
(
'Actions laid out below content if forced override'
,
(
WidgetTester
tester
)
async
{
const
String
contentText
=
'Content'
;
...
...
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