showWithCustomHeaderUiKitView static method
Future<void>
showWithCustomHeaderUiKitView({
- required dynamic context,
- required String title,
- required Widget builder(),
- List<
CNSheetDetent> detents = const [CNSheetDetent.large], - bool prefersGrabberVisible = true,
- bool isModal = false,
- bool prefersEdgeAttachedInCompactHeight = false,
- bool widthFollowsPreferredContentSizeWhenEdgeAttached = false,
- double? preferredCornerRadius,
- double? headerTitleSize,
- dynamic headerTitleWeight,
- dynamic headerTitleColor,
- double? headerHeight,
- dynamic headerBackgroundColor,
- bool showHeaderDivider = true,
- dynamic headerDividerColor,
- String closeButtonPosition = 'trailing',
- String closeButtonIcon = 'xmark',
- double? closeButtonSize,
- dynamic closeButtonColor,
Shows a native sheet with custom Flutter widget content using UiKitView (delegates to CNNativeSheet)
This is the ULTIMATE solution combining:
- Native UISheetPresentationController (real iOS sheet)
- Custom Flutter widgets via UiKitView
- Non-modal behavior (interact with background)
Implementation
static Future<void> showWithCustomHeaderUiKitView({
required context,
required String title,
required Widget Function(BuildContext) builder,
List<CNSheetDetent> detents = const [CNSheetDetent.large],
bool prefersGrabberVisible = true,
bool isModal = false,
bool prefersEdgeAttachedInCompactHeight = false,
bool widthFollowsPreferredContentSizeWhenEdgeAttached = false,
double? preferredCornerRadius,
double? headerTitleSize,
headerTitleWeight,
headerTitleColor,
double? headerHeight,
headerBackgroundColor,
bool showHeaderDivider = true,
headerDividerColor,
String closeButtonPosition = 'trailing',
String closeButtonIcon = 'xmark',
double? closeButtonSize,
closeButtonColor,
}) {
return CNNativeSheet.showWithCustomHeaderUiKitView(
context: context,
title: title,
builder: builder,
detents: detents,
prefersGrabberVisible: prefersGrabberVisible,
isModal: isModal,
prefersEdgeAttachedInCompactHeight: prefersEdgeAttachedInCompactHeight,
widthFollowsPreferredContentSizeWhenEdgeAttached:
widthFollowsPreferredContentSizeWhenEdgeAttached,
preferredCornerRadius: preferredCornerRadius,
headerTitleSize: headerTitleSize,
headerTitleWeight: headerTitleWeight,
headerTitleColor: headerTitleColor,
headerHeight: headerHeight,
headerBackgroundColor: headerBackgroundColor,
showHeaderDivider: showHeaderDivider,
headerDividerColor: headerDividerColor,
closeButtonPosition: closeButtonPosition,
closeButtonIcon: closeButtonIcon,
closeButtonSize: closeButtonSize,
closeButtonColor: closeButtonColor,
);
}