addRoute static method

void addRoute(
  1. String name,
  2. RouteWidgetBuilder builder, {
  3. MeteorRouteType? routeType = MeteorRouteType.native,
})

添加单个路由

Implementation

static void addRoute(
  String name,
  RouteWidgetBuilder builder, {
  MeteorRouteType? routeType = MeteorRouteType.native,
}) {
  if (routeType == MeteorRouteType.material) {
    addMaterialPageRoute(name, builder);
  } else if (routeType == MeteorRouteType.cupertino) {
    addCupertinoPageRoute(name, builder);
  } else if (routeType == MeteorRouteType.dialog) {
    addDialogPageRoute(name, builder);
  } else if (routeType == MeteorRouteType.bottomSheet) {
    addBottomSheetPageRoute(name, builder);
  } else if (routeType == MeteorRouteType.native) {
    if (Platform.isIOS) {
      addCupertinoPageRoute(name, builder);
    } else {
      addMaterialPageRoute(name, builder);
    }
  } else {
    MeteorLog.error('Unknown routeType: $routeType');
  }
}