ListCallback class

ListCallback

ListCallback is a helper class to create callbacks with multiple arguments.

Converts a normal event of type List<dynamic> into its individual arguments, which it then validates each argument type before calling the callback.

final emitter = EventEmitter();

emitter.on('message', ListCallback.args2((String text, int number) {
  print('String: $text, Number: $number');
}));

emitter.emit('message', ['Hello World', 123]);

Constructors

ListCallback()

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

Static Methods

args1<T1>(dynamic callback(T1 data1)) EventCallback<List>
args10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(dynamic callback(T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7, T8 data8, T9 data9, T10 data10)) EventCallback<List>
args2<T1, T2>(dynamic callback(T1 data1, T2 data2)) EventCallback<List>
args3<T1, T2, T3>(dynamic callback(T1 data1, T2 data2, T3 data3)) EventCallback<List>
args4<T1, T2, T3, T4>(dynamic callback(T1 data1, T2 data2, T3 data3, T4 data4)) EventCallback<List>
args5<T1, T2, T3, T4, T5>(dynamic callback(T1 data1, T2 data2, T3 data3, T4 data4, T5 data5)) EventCallback<List>
args6<T1, T2, T3, T4, T5, T6>(dynamic callback(T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6)) EventCallback<List>
args7<T1, T2, T3, T4, T5, T6, T7>(dynamic callback(T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7)) EventCallback<List>
args8<T1, T2, T3, T4, T5, T6, T7, T8>(dynamic callback(T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7, T8 data8)) EventCallback<List>
args9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(dynamic callback(T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7, T8 data8, T9 data9)) EventCallback<List>
emit([dynamic data1, dynamic data2, dynamic data3, dynamic data4, dynamic data5, dynamic data6, dynamic data7, dynamic data8, dynamic data9, dynamic data10]) List