show static method
Future<int?>
show({
- required BuildContext context,
- String? title,
- String? message,
- List<
CNCustomSheetItem> items = const [], - List<
CNSheetDetent> detents = const [CNSheetDetent.large], - bool prefersGrabberVisible = true,
- bool isModal = true,
- double? preferredCornerRadius,
- Color? itemBackgroundColor,
- Color? itemTextColor,
- Color? itemTintColor,
Shows a custom widget sheet with Flutter rendering.
title - Optional title for the sheet
message - Optional message below the title
items - List of items to display (can include custom widgets)
detents - Heights at which the sheet can rest
prefersGrabberVisible - Whether to show the grabber handle
isModal - Whether the sheet is modal. Set to false for nonmodal behavior.
preferredCornerRadius - Custom corner radius for the sheet
itemBackgroundColor - Background color for sheet item buttons
itemTextColor - Text color for sheet item buttons
itemTintColor - Tint color for icons in sheet item buttons
Implementation
static Future<int?> show({
required BuildContext context,
String? title,
String? message,
List<CNCustomSheetItem> items = const [],
List<CNSheetDetent> detents = const [CNSheetDetent.large],
bool prefersGrabberVisible = true,
bool isModal = true,
double? preferredCornerRadius,
Color? itemBackgroundColor,
Color? itemTextColor,
Color? itemTintColor,
}) async {
if (isModal) {
return _showModalSheet(
context: context,
title: title,
message: message,
items: items,
prefersGrabberVisible: prefersGrabberVisible,
preferredCornerRadius: preferredCornerRadius,
itemBackgroundColor: itemBackgroundColor,
itemTextColor: itemTextColor,
itemTintColor: itemTintColor,
);
} else {
return _showNonmodalSheet(
context: context,
title: title,
message: message,
items: items,
detents: detents,
prefersGrabberVisible: prefersGrabberVisible,
preferredCornerRadius: preferredCornerRadius,
itemBackgroundColor: itemBackgroundColor,
itemTextColor: itemTextColor,
itemTintColor: itemTintColor,
);
}
}