makeList static method
List<WebRoute>
makeList({
- required List<
String> paths, - required WebRequest rq,
- List<
String> extraPath = const [], - List<
String> methods = const [RequestMethods.GET], - WaController? controller,
- Future<
String> index()?, - WaAuthController? auth,
- List<
String> permissions = const [], - String widget = "",
- Map<
String, Object?> params = const {}, - String title = "",
- List<
String> excludePaths = const [], - List<
WebRoute> children = const [], - Future<
ApiDoc> ? apiDoc()?, - List<
String> hosts = const ['*'], - List<
int> ports = const [],
Creates a list of WebRoute instances from the given parameters.
paths
is a list of main paths for the routes.
rq
is the WebRequest context for the routes.
All other parameters have default values.
Returns a list of WebRoute instances.
Implementation
static List<WebRoute> makeList({
required List<String> paths,
required WebRequest rq,
List<String> extraPath = const [],
List<String> methods = const [RequestMethods.GET],
WaController? controller,
Future<String> Function()? index,
WaAuthController? auth,
List<String> permissions = const [],
String widget = "",
Map<String, Object?> params = const {},
String title = "",
List<String> excludePaths = const [],
List<WebRoute> children = const [],
Future<ApiDoc>? Function()? apiDoc,
List<String> hosts = const ['*'],
List<int> ports = const [],
}) {
var res = <WebRoute>[];
for (var path in paths) {
res.add(WebRoute(
path: path,
rq: rq,
index: index,
apiDoc: apiDoc,
auth: auth,
children: children,
controller: controller,
excludePaths: excludePaths,
extraPath: extraPath,
methods: methods,
params: params,
permissions: permissions,
title: title,
widget: widget,
hosts: hosts,
ports: ports,
));
}
return res;
}