import 'package:locations/model/map/location_model.dart';
|
|
class SosRecordModel {
|
SosRecordModel({
|
String? portrait,
|
String? from,
|
String? desc,
|
String? phone,
|
SimpleLocation? location,
|
String? createTime,
|
String? targetDesc,
|
}) {
|
_portrait = portrait;
|
_from = from;
|
_desc = desc;
|
_phone = phone;
|
_location = location;
|
_createTime = createTime;
|
_targetDesc = targetDesc;
|
}
|
|
SosRecordModel.fromJson(dynamic json) {
|
_portrait = json['portrait'];
|
_from = json['from'];
|
_desc = json['desc'];
|
_phone = json['phone'];
|
_location =SimpleLocation.fromJson(json['location']);
|
_createTime = json['createTime'];
|
_targetDesc = json['targetDesc'];
|
}
|
|
String? _portrait;
|
String? _from;
|
String? _desc;
|
String? _phone;
|
SimpleLocation? _location;
|
String? _createTime;
|
String? _targetDesc;
|
|
String? get portrait => _portrait;
|
|
String? get from => _from;
|
|
String? get desc => _desc;
|
|
String? get phone => _phone;
|
|
SimpleLocation? get location => _location;
|
|
String? get createTime => _createTime;
|
|
String? get targetDesc => _targetDesc;
|
|
Map<String?, dynamic> toJson() {
|
final map = <String?, dynamic>{};
|
map['portrait'] = _portrait;
|
map['from'] = _from;
|
map['desc'] = _desc;
|
map['phone'] = _phone;
|
if (_location != null) {
|
map['location'] = _location!.toJson();
|
}
|
map['createTime'] = _createTime;
|
map['targetDesc'] = _targetDesc;
|
return map;
|
}
|
}
|