addBottomSheetPageRoute static method

void addBottomSheetPageRoute(
  1. String name,
  2. RouteWidgetBuilder builder, {
  3. InheritedTheme? capturedThemes,
  4. Color? backgroundColor,
  5. double? elevation,
  6. ShapeBorder? shape,
  7. Clip? clipBehavior,
  8. BoxConstraints? constraints,
  9. bool? isScrollControlled,
  10. bool? isDismissible,
  11. bool? enableDrag,
  12. bool? showDragHandle,
  13. bool? useSafeArea,
  14. Color? barrierColor,
  15. String? barrierLabel,
  16. bool? useRootNavigator,
  17. Offset? anchorPoint,
  18. double? scrollControlDisabledMaxHeightRatio = 9.0 / 16.0,
  19. TraversalEdgeBehavior? traversalEdgeBehavior,
  20. AnimationController? transitionAnimationController,
})

添加 BottomSheet 路由

Implementation

static void addBottomSheetPageRoute(
  String name,
  RouteWidgetBuilder builder, {
  InheritedTheme? capturedThemes,
  Color? backgroundColor,
  final double? elevation,
  final ShapeBorder? shape,
  final Clip? clipBehavior,
  final BoxConstraints? constraints,
  final bool? isScrollControlled,
  final bool? isDismissible,
  final bool? enableDrag,
  final bool? showDragHandle,
  final bool? useSafeArea,
  final Color? barrierColor,
  final String? barrierLabel,
  final bool? useRootNavigator,
  final Offset? anchorPoint,
  final double? scrollControlDisabledMaxHeightRatio = 9.0 / 16.0,
  final TraversalEdgeBehavior? traversalEdgeBehavior,
  final AnimationController? transitionAnimationController,
}) {
  RouteOptions routeOptions = RouteOptions(
    builder,
    BottomSheetRouteOptions(
      capturedThemes: capturedThemes,
      backgroundColor: backgroundColor,
      elevation: elevation,
      shape: shape,
      clipBehavior: clipBehavior,
      constraints: constraints,
      isScrollControlled: isScrollControlled,
      isDismissible: isDismissible,
      enableDrag: enableDrag,
      showDragHandle: showDragHandle,
      useSafeArea: useSafeArea,
      barrierColor: barrierColor,
      barrierLabel: barrierLabel,
      useRootNavigator: useRootNavigator,
      anchorPoint: anchorPoint,
      scrollControlDisabledMaxHeightRatio: scrollControlDisabledMaxHeightRatio,
      traversalEdgeBehavior: traversalEdgeBehavior,
      transitionAnimationController: transitionAnimationController,
    ),
  );
  RouterManager.routes.putIfAbsent(name, () => routeOptions);
}