BloomRouteContext class

Route execution context provided to loaders, actions, and metadata builders.

Contains path parameters, parsed query parameters, the full URL, and any contextual data.

Example:

Future<UserData> loadUser(BloomRouteContext context) async {
  final userId = context.params['id'];
  return fetchUser(userId!);
}

Constructors

BloomRouteContext({Map<String, String> params = const {}, Map<String, String> queryParams = const {}, required Uri url, dynamic data})
Creates a BloomRouteContext with the given parameters and URL.
const
BloomRouteContext.fromPath(String path, {Map<String, String> params = const {}, dynamic data})
Constructs a BloomRouteContext by parsing a path string and optional params.
factory

Properties

data → dynamic
Optional contextual payload passed to the route loader or action.
final
hashCode int
The hash code for this object.
no setterinherited
params Map<String, String>
Extracted path parameters from dynamic route segments (e.g. {'id': '42'}).
final
queryParams Map<String, String>
Parsed query parameters from the request URL (e.g. {'tab': 'settings'}).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
url Uri
Full Uri of the matched route.
final

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