Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class VariableWidthBottomSheet extends StatelessWidget {
- final Widget child;
- final double widthOfSheet;
- final EdgeInsetsGeometry padding;
- final AlignmentGeometry align;
- final Color bgColor;
- final double borderRadius;
- const VariableWidthBottomSheet({
- Key? key,
- required this.widthOfSheet,
- required this.child,
- this.padding = const EdgeInsets.all(AppValues.margin),
- this.align = Alignment.bottomCenter,
- this.bgColor = Colors.white,
- this.borderRadius = AppValues.smallRadius,
- }) : super(key: key);
- @override
- Widget build(BuildContext context) {
- return GestureDetector(
- onTap: () => Navigator.of(context).pop(),
- child: Container(
- width: MediaQuery.of(context).size.width,
- padding: padding,
- color: Colors.transparent,
- child: Align(
- alignment: align,
- child: Container(
- decoration: BoxDecoration(
- color: bgColor,
- borderRadius: BorderRadius.all(Radius.circular(borderRadius)),
- ),
- padding: const EdgeInsets.all(AppValues.smallPadding),
- width: widthOfSheet,
- child: child,
- ),
- ),
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement