isValid property

bool get isValid

Returns true if this geofence has valid configuration.

A geofence is valid if:

  • identifier is not empty
  • radius is greater than 0
  • latitude is between -90 and 90
  • longitude is between -180 and 180

Implementation

bool get isValid =>
    identifier.isNotEmpty &&
    radius > 0 &&
    latitude >= -90 &&
    latitude <= 90 &&
    longitude >= -180 &&
    longitude <= 180;