Signal class abstract base

StateBase 继承关系: Singal

  • Store
  • Value
  • _List
  • _Set
  • _Map

Constructors

Signal({String debugLabel = ""})
name: The field name at: The declared type of this field

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
typeArgs List<TypeHook>
为了解决外部json程序无法获知Signal内部范型的问题,实验了一个类型钩子, 貌似可以解决此问题,目前还没想到其他更简单的方案。 json处理比较复杂,而且和Signal核心逻辑无关,还是把json、yaml等处理放在state.dart外部, 这样就需要一些机制可以拿到Map List的范型类型,比如: Value
no setter

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

track<T>({required T useSignal(), ValueChanged<Signal> onChanged = _defaultOnSignalDoNothing, ValueChanged<SignalSubscription> onConnected = _defaultOnConnectedImmediatelyClose}) → T
在客户程序Widget.build时,会有读操作,比如 Text("username: ${username.value}") Signal.watchRead在useSignalcallback执行期间打开一个封闭的瞬时作用域, 期间的Signal读操作会通知onRead,并用onChanged为key注册监听器