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