showAppBottomSheet<T> method

Future<T?> showAppBottomSheet<T>({
  1. required WidgetBuilder builder,
  2. bool isScrollControlled = false,
  3. Color? backgroundColor,
  4. double? elevation,
  5. ShapeBorder? shape,
  6. Clip? clipBehavior,
  7. BoxConstraints? constraints,
  8. Color? barrierColor,
  9. bool useRootNavigator = false,
  10. bool isDismissible = true,
  11. bool enableDrag = true,
  12. RouteSettings? routeSettings,
  13. AnimationController? transitionAnimationController,
  14. 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,
  );
}