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
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