showDefaultBottomSheet<T> function
Future<T?>
showDefaultBottomSheet<T>(
- BuildContext context, {
- required WidgetBuilder contentBuilder,
- WidgetBuilder? headerBuilder,
- String? title,
- bool? centerTitle,
- double? titleSpacing,
- WidgetBuilder? leadingBuilder,
- double? leadingWidth,
- bool automaticallyImplyLeading = true,
- List<
Widget> actionsBuilder(- BuildContext context
- VoidCallback? onConfirm,
- VoidCallback? onCancel,
- String? textConfirm,
- String? textCancel,
- bool showConfirmButton = true,
- bool showCancelButton = false,
- bool? showCloseButton,
- Color? backgroundColor,
- double? elevation,
- ShapeBorder? shape,
- Clip? clipBehavior,
- Color? barrierColor,
- bool isScrollControlled = false,
- bool isDismissible = true,
- bool enableDrag = true,
- EdgeInsetsGeometry? padding,
- EdgeInsetsGeometry? contentPadding = _contentPadding,
- bool persistent = false,
- bool? ignoreSafeArea,
- RouteSettings? settings,
- Duration? enterBottomSheetDuration,
- Duration? exitBottomSheetDuration,
- ActionsPosition? actionsPosition,
默认底部弹框
Implementation
Future<T?> showDefaultBottomSheet<T>(
BuildContext context, {
required WidgetBuilder contentBuilder,
WidgetBuilder? headerBuilder,
String? title,
bool? centerTitle,
double? titleSpacing,
WidgetBuilder? leadingBuilder,
double? leadingWidth,
bool automaticallyImplyLeading = true,
List<Widget> Function(BuildContext context)? actionsBuilder,
WidgetBuilder? footerBuilder,
VoidCallback? onConfirm,
VoidCallback? onCancel,
String? textConfirm,
String? textCancel,
bool showConfirmButton = true,
bool showCancelButton = false,
bool? showCloseButton,
Color? backgroundColor,
double? elevation,
ShapeBorder? shape,
Clip? clipBehavior,
Color? barrierColor,
bool isScrollControlled = false,
bool useRootNavigator = false,
bool isDismissible = true,
bool enableDrag = true,
EdgeInsetsGeometry? padding,
EdgeInsetsGeometry? contentPadding = _contentPadding,
bool persistent = false,
bool? ignoreSafeArea,
RouteSettings? settings,
Duration? enterBottomSheetDuration,
Duration? exitBottomSheetDuration,
ActionsPosition? actionsPosition,
}) async {
return showTxModalBottomSheet<T>(
context,
builder: (_) => TxBottomSheet(
content: contentBuilder(context),
title: title,
titleSpacing: titleSpacing,
centerTitle: centerTitle,
header: headerBuilder?.call(context),
actions: actionsBuilder?.call(context),
onConfirm: onConfirm ?? () => Navigator.pop(context, true),
onCancel: onCancel ?? () => Navigator.pop(context),
textConfirm: textConfirm,
textCancel: textCancel,
padding: padding,
contentPadding: contentPadding,
leading: leadingBuilder?.call(context),
leadingWidth: leadingWidth,
automaticallyImplyLeading: automaticallyImplyLeading,
footer: footerBuilder?.call(context),
actionsPosition: actionsPosition,
),
persistent: persistent,
isScrollControlled: isScrollControlled,
backgroundColor: backgroundColor,
elevation: elevation,
shape: shape,
ignoreSafeArea: ignoreSafeArea ?? true,
clipBehavior: clipBehavior,
isDismissible: isDismissible,
barrierColor: barrierColor,
settings: settings,
enableDrag: enableDrag,
enterBottomSheetDuration:
enterBottomSheetDuration ?? const Duration(milliseconds: 250),
exitBottomSheetDuration:
exitBottomSheetDuration ?? const Duration(milliseconds: 200),
);
}