SharedState class
共享状态存储, 用于全局数据存储
Constructors
-
共享状态存储
factory
Properties
Methods
-
clear(
) → void - 清空所有信息, 但不取消监听的注册且不触发onKeyChange
-
get<
T> (String key) → T? -
根据
key
获取共享状态, 同时需指定类型T
, 如果类型不匹配则抛出异常 -
invalid(
String key) → void -
根据
key
删除共享状态, 同时删除也会通知共享状态变化 -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onKeyChange<
T> (String key) → Stream< T?> - 通知共享状态变化
-
set<
T> (String key, T value, {bool withNotify = true}) → void -
填充共享状态
key
keyvalue
值withNotify
是否通知共享状态变化 通知会通过 onKeyChange 监听 -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited