showWithCustomHeader static method

Future<int?> showWithCustomHeader({
  1. required dynamic context,
  2. required String title,
  3. String? message,
  4. List<CNSheetItem> items = const [],
  5. List<CNSheetItemRow> itemRows = const [],
  6. List<CNSheetInlineActions> inlineActions = const [],
  7. List<CNSheetDetent> detents = const [CNSheetDetent.large],
  8. bool prefersGrabberVisible = true,
  9. bool isModal = true,
  10. bool prefersEdgeAttachedInCompactHeight = false,
  11. bool widthFollowsPreferredContentSizeWhenEdgeAttached = false,
  12. double? preferredCornerRadius,
  13. double? headerTitleSize,
  14. dynamic headerTitleWeight,
  15. dynamic headerTitleColor,
  16. String headerTitleAlignment = 'left',
  17. String? subtitle,
  18. double? subtitleSize,
  19. dynamic subtitleColor,
  20. double? headerHeight,
  21. dynamic headerBackgroundColor,
  22. bool showHeaderDivider = true,
  23. dynamic headerDividerColor,
  24. String closeButtonPosition = 'trailing',
  25. String closeButtonIcon = 'xmark',
  26. double? closeButtonSize,
  27. dynamic closeButtonColor,
  28. dynamic itemBackgroundColor,
  29. dynamic itemTextColor,
  30. dynamic itemTintColor,
  31. void onInlineActionSelected(
    1. int rowIndex,
    2. int actionIndex
    )?,
  32. void onItemSelected(
    1. int index
    )?,
  33. void onItemRowSelected(
    1. int rowIndex,
    2. int itemIndex
    )?,
})

Shows a sheet with custom header (delegates to CNNativeSheet)

Implementation

static Future<int?> showWithCustomHeader({
  required context,
  required String title,
  String? message,
  List<CNSheetItem> items = const [],
  List<CNSheetItemRow> itemRows = const [],
  List<CNSheetInlineActions> inlineActions = const [],
  List<CNSheetDetent> detents = const [CNSheetDetent.large],
  bool prefersGrabberVisible = true,
  bool isModal = true,
  bool prefersEdgeAttachedInCompactHeight = false,
  bool widthFollowsPreferredContentSizeWhenEdgeAttached = false,
  double? preferredCornerRadius,
  double? headerTitleSize,
  headerTitleWeight,
  headerTitleColor,
  String headerTitleAlignment = 'left',
  String? subtitle,
  double? subtitleSize,
  subtitleColor,
  double? headerHeight,
  headerBackgroundColor,
  bool showHeaderDivider = true,
  headerDividerColor,
  String closeButtonPosition = 'trailing',
  String closeButtonIcon = 'xmark',
  double? closeButtonSize,
  closeButtonColor,
  itemBackgroundColor,
  itemTextColor,
  itemTintColor,
  void Function(int rowIndex, int actionIndex)? onInlineActionSelected,
  void Function(int index)? onItemSelected,
  void Function(int rowIndex, int itemIndex)? onItemRowSelected,
}) {
  return CNNativeSheet.showWithCustomHeader(
    context: context,
    title: title,
    message: message,
    items: items,
    itemRows: itemRows,
    inlineActions: inlineActions,
    detents: detents,
    prefersGrabberVisible: prefersGrabberVisible,
    isModal: isModal,
    prefersEdgeAttachedInCompactHeight: prefersEdgeAttachedInCompactHeight,
    widthFollowsPreferredContentSizeWhenEdgeAttached:
        widthFollowsPreferredContentSizeWhenEdgeAttached,
    preferredCornerRadius: preferredCornerRadius,
    headerTitleSize: headerTitleSize,
    headerTitleWeight: headerTitleWeight,
    headerTitleColor: headerTitleColor,
    headerTitleAlignment: headerTitleAlignment,
    subtitle: subtitle,
    subtitleSize: subtitleSize,
    subtitleColor: subtitleColor,
    headerHeight: headerHeight,
    headerBackgroundColor: headerBackgroundColor,
    showHeaderDivider: showHeaderDivider,
    headerDividerColor: headerDividerColor,
    closeButtonPosition: closeButtonPosition,
    closeButtonIcon: closeButtonIcon,
    closeButtonSize: closeButtonSize,
    closeButtonColor: closeButtonColor,
    itemBackgroundColor: itemBackgroundColor,
    itemTextColor: itemTextColor,
    itemTintColor: itemTintColor,
    onInlineActionSelected: onInlineActionSelected,
    onItemSelected: onItemSelected,
    onItemRowSelected: onItemRowSelected,
  );
}