parent
070eb9664f
commit
a4e0651233
@ -1,4 +1,8 @@
|
||||
class UserInfoModel {
|
||||
String nickName;
|
||||
String avatarPath;
|
||||
UserInfoModel({
|
||||
this.nickName,
|
||||
this.avatarPath,
|
||||
});
|
||||
}
|
||||
|
@ -1,18 +1,29 @@
|
||||
import 'package:aku_community_manager/const/resource.dart';
|
||||
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
//登录状态管理
|
||||
class UserProvider extends ChangeNotifier{
|
||||
class UserProvider extends ChangeNotifier {
|
||||
bool _isSigned = false;
|
||||
|
||||
|
||||
bool _isSigned=false;
|
||||
///用户是否登陆
|
||||
get isSigned=>_isSigned;
|
||||
get isSigned => _isSigned;
|
||||
|
||||
///设置用户登陆
|
||||
setisSigned (bool state){
|
||||
_isSigned=state;
|
||||
notifyListeners();
|
||||
setisSigned(bool state) {
|
||||
_isSigned = state;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
UserInfoModel _userInfoModel = UserInfoModel(
|
||||
nickName: '李大海',
|
||||
avatarPath: R.ASSETS_STATIC_TEMP_F3_WEBP,
|
||||
);
|
||||
|
||||
UserInfoModel get userInfoModel => _userInfoModel;
|
||||
|
||||
|
||||
}
|
||||
setNickName(String name) {
|
||||
_userInfoModel.nickName = name;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue