UserService class
用户服务 - 管理用户信息的本地存储
Constructors
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
-
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
-
clearUser(
) → Future< bool> - 清除用户信息(退出登录)
-
getCurrentUser(
) → Future< UserBean?> - 获取当前登录用户信息
-
getCurrentUserOrDefault(
) → Future< UserBean?> - 获取当前用户信息(开发环境下自动使用默认测试用户) 这是一个公共方法,统一处理开发环境下的默认用户逻辑
-
getDefaultTestUser(
) → UserBean - 默认测试用户(仅开发环境)
-
getUserId(
) → Future< int?> - 获取用户 ID
-
getUserMobile(
) → Future< String?> - 获取用户手机号
-
getUserName(
) → Future< String?> - 获取用户名称
-
isUserLoggedIn(
) → Future< bool> - 检查用户是否已登录
-
saveUser(
UserBean user) → Future< bool> - 保存用户信息