improvements
parent
c93afad736
commit
d0af447a09
@ -0,0 +1,27 @@
|
||||
class Coordinates {
|
||||
double? x;
|
||||
double? y;
|
||||
double? longitude;
|
||||
double? latitude;
|
||||
int? orderIndex;
|
||||
|
||||
Coordinates({this.x, this.y, this.longitude, this.latitude, this.orderIndex});
|
||||
|
||||
Coordinates.fromJson(Map<String, dynamic> json) {
|
||||
x = json['x'];
|
||||
y = json['y'];
|
||||
longitude = json['longitude'];
|
||||
latitude = json['latitude'];
|
||||
orderIndex = json['orderIndex'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['x'] = this.x;
|
||||
data['y'] = this.y;
|
||||
data['longitude'] = this.longitude;
|
||||
data['latitude'] = this.latitude;
|
||||
data['orderIndex'] = this.orderIndex;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,86 @@
|
||||
import 'coordinates_model.dart';
|
||||
|
||||
class ZoneModel {
|
||||
int? id;
|
||||
String? referenceId;
|
||||
String? name;
|
||||
ZoneType? zoneType;
|
||||
Location? location;
|
||||
List<Coordinates>? coordinates;
|
||||
|
||||
ZoneModel({this.id, this.referenceId, this.name, this.zoneType, this.location, this.coordinates});
|
||||
|
||||
ZoneModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
referenceId = json['referenceId'];
|
||||
name = json['name'];
|
||||
zoneType = json['zoneType'] != null ? new ZoneType.fromJson(json['zoneType']) : null;
|
||||
location = json['location'] != null ? new Location.fromJson(json['location']) : null;
|
||||
if (json['coordinates'] != null) {
|
||||
coordinates = <Coordinates>[];
|
||||
json['coordinates'].forEach((v) {
|
||||
coordinates!.add(new Coordinates.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['referenceId'] = this.referenceId;
|
||||
data['name'] = this.name;
|
||||
if (this.zoneType != null) {
|
||||
data['zoneType'] = this.zoneType!.toJson();
|
||||
}
|
||||
if (this.location != null) {
|
||||
data['location'] = this.location!.toJson();
|
||||
}
|
||||
if (this.coordinates != null) {
|
||||
data['coordinates'] = this.coordinates!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class ZoneType {
|
||||
int? id;
|
||||
String? name;
|
||||
|
||||
ZoneType({this.id, this.name});
|
||||
|
||||
ZoneType.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['name'] = this.name;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Location {
|
||||
int? id;
|
||||
String? name;
|
||||
String? label;
|
||||
|
||||
Location({this.id, this.name, this.label});
|
||||
|
||||
Location.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
label = json['label'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['name'] = this.name;
|
||||
data['label'] = this.label;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue