You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- import 'package:flutter/material.dart';
- import 'package:zhiying_comm/models/user/user_info_model.dart';
-
- ///
- /// 用户信息
- ///
- class UserInfoNotifier with ChangeNotifier {
- UserInfoModel _userInfo;
-
- /// 初始化,是否需要读取缓存信息?
- UserInfoNotifier();
-
- /// 更新用户数据
- void setUserInfo(UserInfoModel loginUser) async {
- print('${loginUser.toString()}');
- this._userInfo = loginUser;
- // 缓存数据 TODO
- /// token
- }
-
- /// 退出登陆
- void unLogin() {
- this._userInfo = null;
- // 清除缓存数据 TODO
- }
-
- /// 获取登陆数据
- UserInfoModel getUserInfoModel() {
- if (null != _userInfo) {
- return _userInfo;
- }
- // TODO 需要读取缓存的数据?
- return null;
- }
- }
|