draggableSheet<T> static method
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;
});