FxEvent class
事件基类,所有自定义事件都应继承此类。
通过 emit 方法将事件发送到全局 FxEmitter 总线:
class LoginEvent extends FxEvent {
final String userId;
const LoginEvent(this.userId);
}
// 发送
const LoginEvent('user_1').emit();
// 监听
FxEmitter().on<LoginEvent>((event) => print(event.userId));
- Implementers
Constructors
- FxEvent()
-
const
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
-
emit(
) → void -
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