12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- // 用户相关的操作状态 State 类,用于 RiverPod 中 Provider 的定义
- class UserConfig {
- //用户的详情信息
- // UserProfile userProfile;
- String? userName;
- //用户的登录Token
- String? token;
- //用户是否已经登录
- bool haslogin = false;
- //用户的 registrationId 推送标识
- String? registrationId;
- //用户的未读消息数量
- int unreadNotificationsCount = 0;
- /// =================================== 插件自动生成-无需手动修改 ↓ ===================================
- //<editor-fold desc="Data Methods">
- UserConfig({
- this.userName,
- this.token,
- required this.haslogin,
- this.registrationId,
- required this.unreadNotificationsCount,
- });
- @override
- bool operator ==(Object other) =>
- identical(this, other) ||
- (other is UserConfig &&
- runtimeType == other.runtimeType &&
- userName == other.userName &&
- token == other.token &&
- haslogin == other.haslogin &&
- registrationId == other.registrationId &&
- unreadNotificationsCount == other.unreadNotificationsCount);
- @override
- int get hashCode => userName.hashCode ^ token.hashCode ^ haslogin.hashCode ^ registrationId.hashCode ^ unreadNotificationsCount.hashCode;
- @override
- String toString() {
- return 'UserConfig{' +
- ' userName: $userName,' +
- ' token: $token,' +
- ' haslogin: $haslogin,' +
- ' registrationId: $registrationId,' +
- ' unreadNotificationsCount: $unreadNotificationsCount,' +
- '}';
- }
- UserConfig copyWith({
- String? userName,
- String? token,
- bool? haslogin,
- String? registrationId,
- int? unreadNotificationsCount,
- }) {
- return UserConfig(
- userName: userName ?? this.userName,
- token: token ?? this.token,
- haslogin: haslogin ?? this.haslogin,
- registrationId: registrationId ?? this.registrationId,
- unreadNotificationsCount: unreadNotificationsCount ?? this.unreadNotificationsCount,
- );
- }
- //</editor-fold>
- }
|