showBottomSheetOrDialog function
Future
showBottomSheetOrDialog({
- required BuildContext context,
- required Widget child,
- BottomSheetDialog bottomSheetDialog = BottomSheetDialog.Dialog,
Shows a bottom sheet or a dialog based on the specified type.
Implementation
Future<dynamic> showBottomSheetOrDialog({
required BuildContext context,
required Widget child,
BottomSheetDialog bottomSheetDialog = BottomSheetDialog.Dialog,
}) {
if (bottomSheetDialog == BottomSheetDialog.BottomSheet) {
// Show a bottom sheet.
return showModalBottomSheet(context: context, builder: (_) => child);
} else {
// Show a dialog.
return showInDialog(context, builder: (_) => child);
}
}