show<T> static method

Future<T?> show<T>({
  1. required BuildContext context,
  2. required Widget child,
  3. bool showHandle = true,
  4. bool showClose = true,
  5. bool isDismissible = true,
  6. bool enableDrag = true,
  7. EdgeInsetsGeometry? padding,
  8. List<KinSheetDetent> detents = const [KinSheetDetent.large],
  9. KinSheetDetent? initialDetent,
  10. List<KinSheetCustomDetent>? customDetents,
  11. KinMaterial? material,
})

Show the sheet with iOS 18-style presentation.

detents — Which stops the sheet can rest at. Defaults to [large]. When both medium and large are provided, the sheet starts at medium and can be dragged up to large.

initialDetent — Which detent to start at. Defaults to the smallest.

Implementation

static Future<T?> show<T>({
  required BuildContext context,
  required Widget child,
  bool showHandle = true,
  bool showClose = true,
  bool isDismissible = true,
  bool enableDrag = true,
  EdgeInsetsGeometry? padding,
  List<KinSheetDetent> detents = const [KinSheetDetent.large],
  KinSheetDetent? initialDetent,
  List<KinSheetCustomDetent>? customDetents,
  KinMaterial? material,
}) {
  return Navigator.of(context).push<T>(
    _KinSheetModalRoute<T>(
      isDismissible: isDismissible,
      enableDrag: enableDrag,
      detents: detents,
      initialDetent: initialDetent ?? detents.first,
      customDetents: customDetents,
      child: KinSheet(
        showHandle: showHandle,
        showClose: showClose,
        padding: padding,
        material: material,
        child: child,
      ),
    ),
  );
}