showAppBottomSheet<T> method
Future<T?>
showAppBottomSheet<T>({
- required WidgetBuilder builder,
- bool isScrollControlled = false,
- Color? backgroundColor,
- double? elevation,
- ShapeBorder? shape,
- Clip? clipBehavior,
- BoxConstraints? constraints,
- Color? barrierColor,
- bool isDismissible = true,
- bool enableDrag = true,
- RouteSettings? routeSettings,
- AnimationController? transitionAnimationController,
- Offset? anchorPoint,
显示一个通用的模态底部面板(Modal Bottom Sheet) 示例: RouterProxy.getInstance().showAppBottomSheet( builder: (context) => Container( height: 200, child: Center(child: Text('这是一个底部面板')), ), );
Implementation
Future<T?> showAppBottomSheet<T>({
required WidgetBuilder builder,
bool isScrollControlled = false,
Color? backgroundColor,
double? elevation,
ShapeBorder? shape,
Clip? clipBehavior,
BoxConstraints? constraints,
Color? barrierColor,
bool useRootNavigator = false,
bool isDismissible = true,
bool enableDrag = true,
RouteSettings? routeSettings,
AnimationController? transitionAnimationController,
Offset? anchorPoint,
}) async {
if (_context == null) return Future.value(null);
return showModalBottomSheet<T>(
context: _context!,
builder: builder,
backgroundColor: backgroundColor,
elevation: elevation,
shape: shape,
clipBehavior: clipBehavior,
constraints: constraints,
barrierColor: barrierColor,
useRootNavigator: useRootNavigator,
isDismissible: isDismissible,
enableDrag: enableDrag,
routeSettings: routeSettings,
transitionAnimationController: transitionAnimationController,
anchorPoint: anchorPoint,
isScrollControlled: isScrollControlled,
);
}