show method

Future show(
  1. BuildContext context, {
  2. EdgeInsetsGeometry padding = EdgeInsets.zero,
  3. Color color = Colors.grey,
  4. double height = 460,
  5. double? heightFactor,
  6. double barrierOpacity = 0.8,
  7. bool showCloseButton = true,
  8. required Widget body,
})

Implementation

Future<dynamic> show(
  BuildContext context, {
  EdgeInsetsGeometry padding = EdgeInsets.zero,
  Color color = Colors.grey,
  double height = 460,
  double? heightFactor,
  double barrierOpacity = 0.8,
  bool showCloseButton = true,
  required Widget body,
}) {
  final screenHeight = MediaQuery.of(context).size.height;
  return showCupertinoModalBottomSheet(
    context: context,
    duration: const Duration(milliseconds: 300),
    enableDrag: true,
    backgroundColor: color,
    barrierColor: Colors.black.withOpacity(barrierOpacity),
    builder: (context) => FractionallySizedBox(
      heightFactor: heightFactor ?? (100 - (screenHeight - height) / 100 * (screenHeight / 100)) / 100,
      child: ModalLayout(
        padding: padding,
        backgroundColor: color,
        showCloseButton: showCloseButton,
        body: body,
      ),
    ),
  );
}