TxModalBottomSheetRoute<T> constructor
TxModalBottomSheetRoute<T> (
- BuildContext context, {
- WidgetBuilder? builder,
- ThemeData? theme,
- String? barrierLabel,
- Color? backgroundColor,
- bool? isPersistent,
- double? elevation,
- ShapeBorder? shape,
- bool removeTop = true,
- Clip? clipBehavior,
- Color? modalBarrierColor,
- bool isDismissible = true,
- bool enableDrag = true,
- bool isScrollControlled = false,
- RouteSettings? settings,
- Duration enterBottomSheetDuration = const Duration(milliseconds: 250),
- Duration exitBottomSheetDuration = const Duration(milliseconds: 200),
- double? heightRatio,
构造函数参数说明:
builder - 构建弹窗内容的构建器
theme - 自定义主题
barrierLabel - 无障碍标签
backgroundColor - 弹窗背景色
isPersistent - 是否持久化显示
elevation - 阴影高度
shape - 弹窗形状
removeTop - 是否移除顶部安全区域
clipBehavior - 裁剪行为
modalBarrierColor - 遮罩层颜色
isDismissible - 是否可点击遮罩关闭
enableDrag - 是否允许拖动关闭
isScrollControlled - 是否支持内容滚动
heightRatio - 弹窗高度占屏幕比例 (0.0-1.0)
enterBottomSheetDuration - 进入动画时长
exitBottomSheetDuration - 退出动画时长
Implementation
TxModalBottomSheetRoute(
BuildContext context, {
this.builder,
this.theme,
this.barrierLabel,
this.backgroundColor,
this.isPersistent,
this.elevation,
this.shape,
this.removeTop = true,
this.clipBehavior,
this.modalBarrierColor,
this.isDismissible = true,
this.enableDrag = true,
this.isScrollControlled = false,
RouteSettings? settings,
this.enterBottomSheetDuration = const Duration(milliseconds: 250),
this.exitBottomSheetDuration = const Duration(milliseconds: 200),
this.heightRatio,
}) : super(settings: settings);