openCupertinoModalBottomSheet function
Future
openCupertinoModalBottomSheet(
- BuildContext context,
- Widget content,
- CupertinoModalBottomSheetProps props,
- List<
CupertinoActionSheetAction> ? defaultActions,
Implementation
Future openCupertinoModalBottomSheet(
BuildContext context,
Widget content,
CupertinoModalBottomSheetProps props,
List<CupertinoActionSheetAction>? defaultActions,
) {
return showCupertinoModalPopup(
context: context,
anchorPoint: props.anchorPoint,
useRootNavigator: props.useRootNavigator,
barrierColor: props.barrierLabel,
barrierDismissible: props.barrierDismissible,
filter: props.filter,
semanticsDismissible: props.semanticsDismissible,
routeSettings: props.routeSettings,
builder: (ctx) {
return Container(
//to move layout up if keyboard is showed up
margin: EdgeInsets.only(bottom: MediaQuery.of(ctx).viewInsets.bottom),
child: CupertinoActionSheet(
title: props.title,
actionScrollController: props.actionScrollController,
actions: props.actions ?? defaultActions,
cancelButton: props.cancelButton ??
CupertinoActionSheetAction(
isDestructiveAction: true,
onPressed: () => Navigator.pop(context),
child: Text('Cancel'),
),
messageScrollController: props.messageScrollController,
message: content,
),
);
},
);
}