show static method
void
show(
- BuildContext context, {
- required dynamic contentWidget,
- String title = '请选择',
- dynamic confirm,
- dynamic cancel,
- VoidCallback? onConfirm,
- VoidCallback? onCancel,
- bool barrierDismissible = true,
- bool showTitle = true,
Implementation
static void show(
BuildContext context, {
required contentWidget,
String title = '请选择',
dynamic confirm,
dynamic cancel,
VoidCallback? onConfirm,
VoidCallback? onCancel,
bool barrierDismissible = true,
bool showTitle = true,
}) {
final ThemeData theme = Theme.of(context);
showGeneralDialog(
context: context,
pageBuilder: (BuildContext buildContext, Animation<double> animation,
Animation<double> secondaryAnimation) {
final Widget pageChild = BottomPickerWidget(
contentWidget: contentWidget,
confirm: confirm,
cancel: cancel,
onConfirmPressed: onConfirm,
onCancelPressed: onCancel,
barrierDismissible: barrierDismissible,
pickerTitleConfig: PickerTitleConfig(
titleContent: title,
showTitle: showTitle,
),
);
return Theme(data: theme, child: pageChild);
},
barrierDismissible: barrierDismissible,
barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel,
barrierColor: Colors.black54,
transitionDuration: const Duration(milliseconds: 150),
transitionBuilder: (BuildContext context, Animation<double> animation,
Animation<double> secondaryAnimation, Widget child) {
return FadeTransition(
opacity: CurvedAnimation(
parent: animation,
curve: Curves.easeOut,
),
child: child,
);
},
useRootNavigator: true,
);
}