@@ -46,6 +46,7 @@ class BottomAppBar extends StatefulWidget {
46
46
Key key,
47
47
this .color,
48
48
this .elevation: 8.0 ,
49
+ this .hasNotch: true ,
49
50
this .child,
50
51
}) : assert (elevation != null ),
51
52
assert (elevation >= 0.0 ),
@@ -68,6 +69,17 @@ class BottomAppBar extends StatefulWidget {
68
69
/// Defaults to 8, the appropriate elevation for bottom app bars.
69
70
final double elevation;
70
71
72
+ /// Whether to make a notch in the bottom app bar's shape for the floating
73
+ /// action button.
74
+ ///
75
+ /// When true, the bottom app bar uses
76
+ /// [ScaffoldGeometry.floatingActionButtonNotch] to make a notch along its
77
+ /// top edge, where it is overlapped by the
78
+ /// [ScaffoldGeometry.floatingActionButtonArea] .
79
+ ///
80
+ /// When false, the shape of the bottom app bar is a rectangle.
81
+ final bool hasNotch;
82
+
71
83
@override
72
84
State createState () => new _BottomAppBarState ();
73
85
}
@@ -83,8 +95,11 @@ class _BottomAppBarState extends State<BottomAppBar> {
83
95
84
96
@override
85
97
Widget build (BuildContext context) {
98
+ final CustomClipper <Path > clipper = widget.hasNotch
99
+ ? new _BottomAppBarClipper (geometry: geometryListenable)
100
+ : const ShapeBorderClipper (shape: const RoundedRectangleBorder ());
86
101
return new PhysicalShape (
87
- clipper: new _BottomAppBarClipper (geometry : geometryListenable) ,
102
+ clipper: clipper ,
88
103
elevation: widget.elevation,
89
104
// TODO(amirh): use a default color from the theme.
90
105
color: widget.color ?? Colors .white,
0 commit comments