isValid property

bool get isValid

Returns true if this polygon geofence has valid configuration.

A polygon geofence is valid if:

  • identifier is not empty
  • has at least 3 vertices
  • all vertices have valid coordinates

Implementation

bool get isValid =>
    identifier.isNotEmpty &&
    vertices.length >= 3 &&
    vertices.every((v) => v.isValid);