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 useRootNavigator = true,
  7. VoidCallback? onDismiss,
})

Draggable scrollable sheet

Implementation

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