|
class LocationUserModel {
|
LocationUserModel({
|
String? id,
|
int? targetUid,
|
String? targetName,
|
String? targetPhone,
|
LocationInviteStatus? status,
|
LocationUserType? userType,}){
|
_id = id;
|
_targetUid = targetUid;
|
_targetName = targetName;
|
_targetPhone = targetPhone;
|
_status = status;
|
_userType = userType;
|
}
|
|
LocationUserModel.fromJson(dynamic json) {
|
_id = json['id'];
|
_targetUid = json['targetUid'];
|
_targetName = json['targetName'];
|
_targetPhone = json['targetPhone'];
|
switch(json['status']){
|
case "sentInvite":
|
_status=LocationInviteStatus.sentInvite;
|
break;
|
case "agree":
|
_status=LocationInviteStatus.agree;
|
break;
|
case "reject":
|
_status=LocationInviteStatus.reject;
|
break;
|
}
|
|
switch(json['userType']){
|
case "son":
|
_userType=LocationUserType.son;
|
break;
|
case "daughter":
|
_userType=LocationUserType.daughter;
|
break;
|
case "husband":
|
_userType=LocationUserType.husband;
|
break;
|
case "wife":
|
_userType=LocationUserType.wife;
|
break;
|
case "father":
|
_userType=LocationUserType.father;
|
break;
|
case "mother":
|
_userType=LocationUserType.mother;
|
break;
|
case "other":
|
_userType=LocationUserType.other;
|
break;
|
|
}
|
|
|
|
}
|
String? _id;
|
int? _targetUid;
|
String? _targetName;
|
String? _targetPhone;
|
LocationInviteStatus? _status;
|
LocationUserType? _userType;
|
|
String? get id => _id;
|
int? get targetUid => _targetUid;
|
String? get targetName => _targetName;
|
String? get targetPhone => _targetPhone;
|
LocationInviteStatus? get status => _status;
|
LocationUserType? get userType => _userType;
|
|
Map<String?, dynamic> toJson() {
|
final map = <String?, dynamic>{};
|
map['id'] = _id;
|
map['targetUid'] = _targetUid;
|
map['targetName'] = _targetName;
|
map['targetPhone'] = _targetPhone;
|
map['status'] = _status;
|
map['userType'] = _userType;
|
return map;
|
}
|
|
}
|
|
|
enum LocationUserType{
|
father,
|
mother,
|
husband,
|
wife,
|
daughter,
|
son,
|
other
|
}
|
|
|
enum LocationInviteStatus{
|
sentInvite,
|
agree,
|
reject
|
}
|