ServerFunction<I, O> constructor
ServerFunction<I, O> ({
- required ServerFunctionHandler<
I, O> handler, - String? id,
- ValueDecoder<
I> ? decodeInput, - HttpMethod method = HttpMethod.post,
- Iterable<
Middleware> middleware = const <Middleware>[],
Creates a server function and its invocation policy.
Implementation
ServerFunction({
required this.handler,
this.id,
this.decodeInput,
this.method = HttpMethod.post,
Iterable<Middleware> middleware = const <Middleware>[],
}) : middleware = List<Middleware>.unmodifiable(middleware) {
if (id?.isEmpty ?? false) {
throw ArgumentError.value(id, 'id', 'Must not be empty.');
}
}