v1.0.1
This commit is contained in:
34
lib/models/user/bind_status_model.dart
Normal file
34
lib/models/user/bind_status_model.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class UserBindStatusModel {
|
||||
UserBindStatusModel({
|
||||
required this.isBindTel,
|
||||
required this.isSetPwd,
|
||||
});
|
||||
|
||||
factory UserBindStatusModel.fromJson(Map<String, dynamic> json) =>
|
||||
UserBindStatusModel(
|
||||
isBindTel: asT<int>(json['is_bind_tel'])!,
|
||||
isSetPwd: asT<int>(json['is_set_pwd'])!,
|
||||
);
|
||||
|
||||
int isBindTel;
|
||||
int isSetPwd;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'is_bind_tel': isBindTel,
|
||||
'is_set_pwd': isSetPwd,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user