Param mixin

Mixin that adds multi-parameter path building to segments.

This mixin provides the params method for appending multiple path segments at once.

Example:

class ApiSegment extends Segment with Param {
  ApiSegment() : super('api');
}

final apiEvents = ApiSegment();
apiEvents.params(['v1', 'users', '123']).emit<User>(userData);
// Results in topic: 'api/v1/users/123'
Superclass constraints

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
topic String
The current topic path being built.
getter/setter pairinherited

Methods

$(String data) Segment
Appends a new segment to the current topic path.
inherited
emit<T>([T? data, bool retain = false]) → void
Emits an event on the current topic path.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
on<T>(EventCallback<T> callback) EventListener<T>
Registers a listener for events on the current topic path.
inherited
params(List<String> params) Segment
Appends multiple parameters to the current topic path.
toString() String
A string representation of this object.
inherited
waitForData<T>() Future<T?>
Waits for a single event and returns the event data.
inherited
waitForEvent<T>(EventCallback<T> callback) Future<void>
Waits for a single event on the current topic path.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited