draggableSheet<T> static method

Future<T?> draggableSheet<T>(
  1. Widget child, {
  2. double initialChildSize = 0.5,
  3. double minChildSize = 0.25,
  4. double maxChildSize = 0.9,
  5. bool expand = false,
  6. bool snap = false,
  7. List<double>? snapSizes,
  8. bool useRootNavigator = true,
  9. bool showDragHandle = false,
  10. Color? backgroundColor,
  11. ShapeBorder? shape,
  12. VoidCallback? onDismiss,
})

Implementation

static Future<T?> draggableSheet<T>(
  Widget child, {
  double initialChildSize = 0.5,
  double minChildSize = 0.25,
  double maxChildSize = 0.9,
  bool expand = false,
  bool snap = false,
  List<double>? snapSizes,
  bool useRootNavigator = true,
  bool showDragHandle = false,
  Color? backgroundColor,
  ShapeBorder? shape,
  VoidCallback? onDismiss,
}) =>
    showModalBottomSheet<T>(
      context: navigatorKey.currentContext!,
      isScrollControlled: true,
      useRootNavigator: useRootNavigator,
      showDragHandle: showDragHandle,
      backgroundColor: backgroundColor,
      shape: shape,
      builder: (BuildContext context) => DraggableScrollableSheet(
        expand: expand,
        snap: snap,
        snapSizes: snapSizes,
        initialChildSize: initialChildSize,
        minChildSize: minChildSize,
        maxChildSize: maxChildSize,
        builder: (BuildContext context, ScrollController controller) => SingleChildScrollView(
          controller: controller,
          child: child,
        ),
      ),
    ).then((T? value) {
      onDismiss?.call();
      return value;
    });