addRegion method

  1. @override
Future<String?> addRegion(
  1. GeofenceRegion geofenceRegion
)
override

The function addRegion takes a GeofenceRegion object, converts it to a JSON map, and invokes a method on a channel with the arguments, returning the result as a Future<String?>. @param {GeofenceRegion} geofenceRegion - The geofenceRegion parameter is an instance of the GeofenceRegion class. It represents a geographical region for which you want to add a geofence. @returns The method is returning a Future object that resolves to a String or null.

Implementation

@override
Future<String?> addRegion(GeofenceRegion geofenceRegion) async {
  Map<String, dynamic> arguments = geofenceRegion.toJson();
  final returnVal =
      await methodChannel.invokeMethod<String>('addRegion', arguments);
  return returnVal;
}