SharedState class

共享状态存储, 用于全局数据存储

Constructors

SharedState()
共享状态存储
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
store Map<String, dynamic>
获取raw数据(除了测试应该没啥用)
no setter

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 key valuewithNotify 是否通知共享状态变化 通知会通过 onKeyChange 监听
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited