registerLocationUpdate static method

Future<void> registerLocationUpdate(
  1. void callback(
    1. LocationDto
    ), {
  2. void initCallback(
    1. Map<String, dynamic>
    )?,
  3. Map<String, dynamic> initDataCallback = const {},
  4. void disposeCallback()?,
  5. bool autoStop = false,
  6. AndroidSettings androidSettings = const AndroidSettings(),
  7. IOSSettings iosSettings = const IOSSettings(),
})

Implementation

static Future<void> registerLocationUpdate(
    void Function(LocationDto) callback,
    {void Function(Map<String, dynamic>)? initCallback,
    Map<String, dynamic> initDataCallback = const {},
    void Function()? disposeCallback,
    bool autoStop = false,
    AndroidSettings androidSettings = const AndroidSettings(),
    IOSSettings iosSettings = const IOSSettings()}) async {
  if (autoStop) {
    WidgetsBinding.instance.addObserver(AutoStopHandler());
  }

  final args = SettingsUtil.getArgumentsMap(
      callback: callback,
      initCallback: initCallback,
      initDataCallback: initDataCallback,
      disposeCallback: disposeCallback,
      androidSettings: androidSettings,
      iosSettings: iosSettings);

  await _channel.invokeMethod(
      Keys.METHOD_PLUGIN_REGISTER_LOCATION_UPDATE, args);
}