addGeofence static method

Future<bool> addGeofence(
  1. UGeofence fence
)

Starts watching fence. Native on Android, iOS, macOS and Windows (works in the background); elsewhere evaluated in Dart while the app runs.

Implementation

static Future<bool> addGeofence(UGeofence fence) async {
  final bool? native = kIsWeb ? null : await _call<bool>("addGeofence", fence.toMap());
  if (native != null) return native;
  _soft[fence.id] = fence;
  _softWatch ??= positions(const ULocationSettings(accuracy: ULocationAccuracy.balanced, distanceFilter: 20)).listen(_evaluate, onError: (Object _) {});
  return true;
}