Geofence constructor
Geofence({})
Implementation
Geofence(
{required String identifier,
double? radius,
double? latitude,
double? longitude,
bool? notifyOnEntry,
bool? notifyOnExit,
bool? notifyOnDwell,
int? loiteringDelay,
Map<String, dynamic>? extras,
List<List<double>>? vertices}) {
if (vertices == null) {
// Circular Geofence
if (radius == null || latitude == null || longitude == null) {
throw ArgumentError("Geofence requires radius, latitude and longitude");
}
} else {
// Polygon Geofence
this.vertices = vertices;
}
if (radius != null) this.radius = radius * 1.0;
if (latitude != null) this.latitude = latitude * 1.0;
if (longitude != null) this.longitude = longitude * 1.0;
this.identifier = identifier;
this.notifyOnEntry = notifyOnEntry;
this.notifyOnExit = notifyOnExit;
this.notifyOnDwell = notifyOnDwell;
this.loiteringDelay = loiteringDelay;
this.extras = extras;
}