12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- // 用户相关的操作状态 State 类,用于 RiverPod 中 Provider 的定义
- import 'package:domain/entity/user_me_entity.dart';
- class UserConfig {
- //用户的详情信息
- UserMeEntity? user;
- //用户的登录Token
- String? token;
- //用户姓名
- String? userName;
- //用户是否已经登录
- bool hasLogin = false;
- //用户的 registrationId 推送标识
- String? registrationId;
- //用户的未读消息数量
- int unreadNotificationsCount = 0;
- /// =================================== 插件自动生成-无需手动修改 ↓ ===================================
- //<editor-fold desc="Data Methods">
- UserConfig({
- this.user,
- this.token,
- this.userName,
- required this.hasLogin,
- this.registrationId,
- required this.unreadNotificationsCount,
- });
- UserConfig copyWith({
- UserMeEntity? user,
- String? token,
- String? userName,
- bool? hasLogin,
- String? registrationId,
- int? unreadNotificationsCount,
- }) {
- return UserConfig(
- user: user ?? this.user,
- token: token ?? this.token,
- userName: userName ?? this.userName,
- hasLogin: hasLogin ?? this.hasLogin,
- registrationId: registrationId ?? this.registrationId,
- unreadNotificationsCount: unreadNotificationsCount ?? this.unreadNotificationsCount,
- );
- }
- //</editor-fold>
- }
|