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
1f3eb503
Unverified
Commit
1f3eb503
authored
Feb 24, 2018
by
amirh
Committed by
GitHub
Feb 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a hasNotch flag to BottomAppBar (#14856)
parent
c6e7ad1c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
bottom_app_bar.dart
packages/flutter/lib/src/material/bottom_app_bar.dart
+16
-1
bottom_app_bar_test.dart
packages/flutter/test/material/bottom_app_bar_test.dart
+6
-0
No files found.
packages/flutter/lib/src/material/bottom_app_bar.dart
View file @
1f3eb503
...
...
@@ -46,6 +46,7 @@ class BottomAppBar extends StatefulWidget {
Key
key
,
this
.
color
,
this
.
elevation
:
8.0
,
this
.
hasNotch
:
true
,
this
.
child
,
})
:
assert
(
elevation
!=
null
),
assert
(
elevation
>=
0.0
),
...
...
@@ -68,6 +69,17 @@ class BottomAppBar extends StatefulWidget {
/// Defaults to 8, the appropriate elevation for bottom app bars.
final
double
elevation
;
/// Whether to make a notch in the bottom app bar's shape for the floating
/// action button.
///
/// When true, the bottom app bar uses
/// [ScaffoldGeometry.floatingActionButtonNotch] to make a notch along its
/// top edge, where it is overlapped by the
/// [ScaffoldGeometry.floatingActionButtonArea].
///
/// When false, the shape of the bottom app bar is a rectangle.
final
bool
hasNotch
;
@override
State
createState
()
=>
new
_BottomAppBarState
();
}
...
...
@@ -83,8 +95,11 @@ class _BottomAppBarState extends State<BottomAppBar> {
@override
Widget
build
(
BuildContext
context
)
{
final
CustomClipper
<
Path
>
clipper
=
widget
.
hasNotch
?
new
_BottomAppBarClipper
(
geometry:
geometryListenable
)
:
const
ShapeBorderClipper
(
shape:
const
RoundedRectangleBorder
());
return
new
PhysicalShape
(
clipper:
new
_BottomAppBarClipper
(
geometry:
geometryListenable
)
,
clipper:
clipper
,
elevation:
widget
.
elevation
,
// TODO(amirh): use a default color from the theme.
color:
widget
.
color
??
Colors
.
white
,
...
...
packages/flutter/test/material/bottom_app_bar_test.dart
View file @
1f3eb503
...
...
@@ -33,6 +33,12 @@ void main() {
)
);
});
// TODO(amirh): test a BottomAppBar with hasNotch=false and an overlapping
// FAB.
//
// Cannot test this before https://github.com/flutter/flutter/pull/14368
// as there is no way to make the FAB and BAB overlap.
}
// 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