You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.6 KiB
Dart
63 lines
1.6 KiB
Dart
4 years ago
|
import 'package:diplomaticquarterapp/generated/json/base/json_convert_content.dart';
|
||
|
import 'package:diplomaticquarterapp/generated/json/base/json_field.dart';
|
||
|
|
||
|
class GeoZonesResponseModel with JsonConvert<GeoZonesResponseModel> {
|
||
|
@JSONField(name: "GEOF_ID")
|
||
|
int geofId;
|
||
|
@JSONField(name: "Description")
|
||
|
String description;
|
||
|
@JSONField(name: "DescriptionN")
|
||
|
String descriptionN;
|
||
|
@JSONField(name: "Latitude")
|
||
|
String latitude;
|
||
|
@JSONField(name: "Longitude")
|
||
|
String longitude;
|
||
|
@JSONField(name: "Radius")
|
||
|
int radius;
|
||
|
@JSONField(name: "Type")
|
||
|
int type;
|
||
|
@JSONField(name: "ProjectID")
|
||
|
int projectID;
|
||
|
@JSONField(name: "ImageURL")
|
||
|
String imageURL;
|
||
|
@JSONField(name: "IsCity")
|
||
|
bool isCity;
|
||
|
|
||
|
// Outside Server Response
|
||
|
bool isRegistered = false;
|
||
|
bool onEntry = true;
|
||
|
bool onExit = true;
|
||
|
|
||
|
String geofenceId() {
|
||
|
return "$geofId\_${description.replaceAll(" ", "")}";
|
||
|
}
|
||
|
|
||
|
static get(String coordinates, int radius, String name) {
|
||
|
coordinates = coordinates.replaceAll(" ", "");
|
||
|
var geo = GeoZonesResponseModel();
|
||
|
geo.latitude = coordinates.split(",").first;
|
||
|
geo.longitude = coordinates.split(",").last;
|
||
|
geo.radius = radius;
|
||
|
geo.description = name;
|
||
|
return geo;
|
||
|
}
|
||
|
|
||
|
static GeoZonesResponseModel zkH() {
|
||
|
var geo = GeoZonesResponseModel();
|
||
|
geo.latitude = "24.691136";
|
||
|
geo.longitude = "46.650116";
|
||
|
geo.radius = 150;
|
||
|
geo.description = "zkH";
|
||
|
return geo;
|
||
|
}
|
||
|
|
||
|
static GeoZonesResponseModel csO() {
|
||
|
var geo = GeoZonesResponseModel();
|
||
|
geo.latitude = "24.7087913";
|
||
|
geo.longitude = "46.6656461";
|
||
|
geo.radius = 150;
|
||
|
geo.description = "csO";
|
||
|
return geo;
|
||
|
}
|
||
|
}
|