Sesstion class

封装SharedPreferences为单例模式

Constructors

Sesstion()
工厂构造函数 返回实例对象
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

Methods

clear() Future<bool>
清空存储 并总是返回true
getKeys() Future<Set<String>>
获取所有的key 类型为Set
getStorage(String key) Future
获取存储 注意:返回的是一个Future对象 要么用await接收 要么在.then中接收
hasKey(String key) Future<bool>
是否包含某个key
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeStorage(String key) Future<bool>
删除key指向的存储 如果key存在则删除并返回true,否则返回false
setStorage(String key, dynamic value) → dynamic
设置存储
toString() String
A string representation of this object.
inherited

Operators

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