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
a12a69a4
Unverified
Commit
a12a69a4
authored
May 24, 2022
by
Taha Tesser
Committed by
GitHub
May 24, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix `BottomAppBar` dip without FAB (#104490)
parent
d7a1b498
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
bottom_app_bar.dart
packages/flutter/lib/src/material/bottom_app_bar.dart
+2
-1
bottom_app_bar_test.dart
packages/flutter/test/material/bottom_app_bar_test.dart
+25
-0
No files found.
packages/flutter/lib/src/material/bottom_app_bar.dart
View file @
a12a69a4
...
...
@@ -128,8 +128,9 @@ class _BottomAppBarState extends State<BottomAppBar> {
@override
Widget
build
(
BuildContext
context
)
{
final
BottomAppBarTheme
babTheme
=
BottomAppBarTheme
.
of
(
context
);
final
bool
hasFab
=
Scaffold
.
of
(
context
).
hasFloatingActionButton
;
final
NotchedShape
?
notchedShape
=
widget
.
shape
??
babTheme
.
shape
;
final
CustomClipper
<
Path
>
clipper
=
notchedShape
!=
null
final
CustomClipper
<
Path
>
clipper
=
notchedShape
!=
null
&&
hasFab
?
_BottomAppBarClipper
(
geometry:
geometryListenable
,
shape:
notchedShape
,
...
...
packages/flutter/test/material/bottom_app_bar_test.dart
View file @
a12a69a4
...
...
@@ -474,6 +474,31 @@ void main() {
),
);
});
testWidgets
(
'BottomAppBar does not apply custom clipper without FAB'
,
(
WidgetTester
tester
)
async
{
Widget
buildWidget
({
Widget
?
fab
})
{
return
MaterialApp
(
home:
Scaffold
(
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerDocked
,
floatingActionButton:
fab
,
bottomNavigationBar:
BottomAppBar
(
color:
Colors
.
green
,
shape:
const
CircularNotchedRectangle
(),
child:
Container
(
height:
50
),
),
),
);
}
await
tester
.
pumpWidget
(
buildWidget
(
fab:
FloatingActionButton
(
onPressed:
()
{
})));
PhysicalShape
physicalShape
=
tester
.
widget
(
find
.
byType
(
PhysicalShape
).
at
(
0
));
expect
(
physicalShape
.
clipper
.
toString
(),
'_BottomAppBarClipper'
);
await
tester
.
pumpWidget
(
buildWidget
());
physicalShape
=
tester
.
widget
(
find
.
byType
(
PhysicalShape
).
at
(
0
));
expect
(
physicalShape
.
clipper
.
toString
(),
'ShapeBorderClipper'
);
});
}
// The bottom app bar clip path computation is only available at paint time.
...
...
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