Jaime Blasco

Add support to all params showBarModalButtonSheet

... ... @@ -10,11 +10,18 @@ const Radius _default_bar_top_radius = Radius.circular(15);
class BarBottomSheet extends StatelessWidget {
final Widget child;
final Widget topControl;
final Radius topRadius;
final Widget control;
final Clip clipBehavior;
final double elevation;
final ShapeBorder shape;
const BarBottomSheet(
{Key key, this.child, this.topControl, @required this.topRadius})
{Key key,
this.child,
this.control,
this.clipBehavior,
this.shape,
this.elevation})
: super(key: key);
@override
... ... @@ -28,7 +35,7 @@ class BarBottomSheet extends StatelessWidget {
SizedBox(height: 12),
SafeArea(
bottom: false,
child: topControl ??
child: control ??
Container(
height: 6,
width: 40,
... ... @@ -41,21 +48,20 @@ class BarBottomSheet extends StatelessWidget {
Flexible(
flex: 1,
fit: FlexFit.loose,
child: ClipRRect(
borderRadius:
BorderRadius.only(topLeft: topRadius, topRight: topRadius),
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).scaffoldBackgroundColor,
boxShadow: [
BoxShadow(
blurRadius: 10,
color: Colors.black12,
spreadRadius: 5)
]),
width: double.infinity,
child: MediaQuery.removePadding(
context: context, removeTop: true, child: child)),
child: Material(
shape: RoundedRectangleBorder(
side: BorderSide(),
borderRadius: BorderRadius.only(
topLeft: _default_bar_top_radius,
topRight: _default_bar_top_radius),
),
clipBehavior: clipBehavior ?? Clip.hardEdge,
elevation: elevation ?? 2,
child: SizedBox(
width: double.infinity,
child: MediaQuery.removePadding(
context: context, removeTop: true, child: child),
),
),
),
]),
... ... @@ -78,7 +84,6 @@ Future<T> showBarModalBottomSheet<T>({
bool useRootNavigator = false,
bool isDismissible = true,
bool enableDrag = true,
Radius topRadius = _default_bar_top_radius,
Widget topControl,
Duration duration,
}) async {
... ... @@ -96,8 +101,10 @@ Future<T> showBarModalBottomSheet<T>({
bounce: bounce,
containerBuilder: (_, __, child) => BarBottomSheet(
child: child,
topRadius: topRadius,
topControl: topControl,
control: topControl,
clipBehavior: clipBehavior,
shape: shape,
elevation: elevation,
),
secondAnimationController: secondAnimation,
expanded: expand,
... ...