Commit acbef6aa authored by Peter Zagoranski's avatar Peter Zagoranski Committed by Dan Field

Added elevation to BottomSheet (#21998)

parent fafd615a
...@@ -53,11 +53,13 @@ class BottomSheet extends StatefulWidget { ...@@ -53,11 +53,13 @@ class BottomSheet extends StatefulWidget {
Key key, Key key,
this.animationController, this.animationController,
this.enableDrag = true, this.enableDrag = true,
this.elevation = 0.0,
@required this.onClosing, @required this.onClosing,
@required this.builder @required this.builder
}) : assert(enableDrag != null), }) : assert(enableDrag != null),
assert(onClosing != null), assert(onClosing != null),
assert(builder != null), assert(builder != null),
assert(elevation != null),
super(key: key); super(key: key);
/// The animation that controls the bottom sheet's position. /// The animation that controls the bottom sheet's position.
...@@ -85,6 +87,12 @@ class BottomSheet extends StatefulWidget { ...@@ -85,6 +87,12 @@ class BottomSheet extends StatefulWidget {
/// Default is true. /// Default is true.
final bool enableDrag; final bool enableDrag;
/// The z-coordinate at which to place this material. This controls the size
/// of the shadow below the material.
///
/// Defaults to 0.
final double elevation;
@override @override
_BottomSheetState createState() => _BottomSheetState(); _BottomSheetState createState() => _BottomSheetState();
...@@ -137,6 +145,7 @@ class _BottomSheetState extends State<BottomSheet> { ...@@ -137,6 +145,7 @@ class _BottomSheetState extends State<BottomSheet> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final Widget bottomSheet = Material( final Widget bottomSheet = Material(
key: _childKey, key: _childKey,
elevation: widget.elevation,
child: widget.builder(context), child: widget.builder(context),
); );
return !widget.enableDrag ? bottomSheet : GestureDetector( return !widget.enableDrag ? bottomSheet : GestureDetector(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment