Commit b0ebbacd by tanghuan

账号与安全中提示绑定孩子信息

1 parent 6cfc527e
...@@ -12,9 +12,13 @@ class AccountState extends Equatable { ...@@ -12,9 +12,13 @@ class AccountState extends Equatable {
final String nickname; final String nickname;
final String imgIcon; final String imgIcon;
// 孩子信息
final String className; final String className;
final String stuName; final String stuName;
// 是否绑定孩子
final bool bindStu;
const AccountState({ const AccountState({
this.loaded = false, this.loaded = false,
this.name = '', this.name = '',
...@@ -23,7 +27,7 @@ class AccountState extends Equatable { ...@@ -23,7 +27,7 @@ class AccountState extends Equatable {
this.imgIcon = '', this.imgIcon = '',
this.className = '', this.className = '',
this.stuName = '', this.stuName = '',
this.bindStu = true,
}); });
AccountState copyWith({ AccountState copyWith({
...@@ -34,6 +38,7 @@ class AccountState extends Equatable { ...@@ -34,6 +38,7 @@ class AccountState extends Equatable {
String? imgIcon, String? imgIcon,
String? className, String? className,
String? stuName, String? stuName,
bool? bindStu,
}) { }) {
return AccountState( return AccountState(
loaded: loaded ?? this.loaded, loaded: loaded ?? this.loaded,
...@@ -43,6 +48,7 @@ class AccountState extends Equatable { ...@@ -43,6 +48,7 @@ class AccountState extends Equatable {
imgIcon: imgIcon ?? this.imgIcon, imgIcon: imgIcon ?? this.imgIcon,
className: className ?? this.className, className: className ?? this.className,
stuName: stuName ?? this.stuName, stuName: stuName ?? this.stuName,
bindStu: bindStu ?? this.bindStu,
); );
} }
...@@ -55,6 +61,7 @@ class AccountState extends Equatable { ...@@ -55,6 +61,7 @@ class AccountState extends Equatable {
imgIcon, imgIcon,
className, className,
stuName, stuName,
bindStu,
]; ];
} }
...@@ -76,6 +83,7 @@ class AccountCubit extends Cubit<AccountState> { ...@@ -76,6 +83,7 @@ class AccountCubit extends Cubit<AccountState> {
var code = result['code']; var code = result['code'];
var data = result['data']; var data = result['data'];
if (code != 0) { if (code != 0) {
emit(state.copyWith(loaded: true, bindStu: false));
return; return;
} }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!