PageResponse<T> class
sealed
Sealed class representing possible responses from a page loader.
A loader can return one of:
- PageData - Render the page with the provided typed data
- PageRedirect - Redirect to another URL
- PageError - Render an error page
Usage
@override
Future<PageResponse<User>> loader(PageRequest request) async {
final userId = request.pathParamInt('id');
if (userId <= 0) {
return PageError.badRequest('Invalid user ID');
}
final user = await fetchUser(userId);
if (user == null) {
return PageRedirect('/404');
}
return PageData(user);
}
- Implementers
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited