anonymous__ static method
Implementation
static Future<AMapGeoFenceManagerDelegate> anonymous__() async {
final __result__ = await kAmapLocationFluttifyChannel.invokeMethod('AMapGeoFenceManagerDelegate::createAnonymous__');
final __object__ = AmapLocationFluttifyIOSAs<AMapGeoFenceManagerDelegate>(__result__)!;
// handle callback
MethodChannel('AMapGeoFenceManagerDelegate::Callback@${__object__.refId}', kAmapLocationFluttifyMethodCodec)
.setMethodCallHandler((methodCall) async {
try {
final args = methodCall.arguments as Map;
switch (methodCall.method) {
case 'amapGeoFenceManager_doRequireLocationAuth':
// print log
if (fluttifyLogEnabled) {
debugPrint('fluttify-dart-callback: __object__.amapGeoFenceManager_doRequireLocationAuth?.call([\'manager\':${args['manager']}, \'locationManager\':${args['locationManager']}])');
}
// handle the native call
__object__.amapGeoFenceManager_doRequireLocationAuth?.call(AmapLocationFluttifyIOSAs<AMapGeoFenceManager>(args['manager']), AmapLocationFluttifyIOSAs<CLLocationManager>(args['locationManager']));
break;
case 'amapGeoFenceManager_didAddRegionForMonitoringFinished_customID_error':
// print log
if (fluttifyLogEnabled) {
debugPrint('fluttify-dart-callback: __object__.amapGeoFenceManager_didAddRegionForMonitoringFinished_customID_error?.call([\'manager\':${args['manager']}, \'regions\':${args['regions']}, \'customID\':${args['customID']}, \'error\':${args['error']}])');
}
// handle the native call
__object__.amapGeoFenceManager_didAddRegionForMonitoringFinished_customID_error?.call(AmapLocationFluttifyIOSAs<AMapGeoFenceManager>(args['manager']), (args['regions'] as List? ?? []).map((it) => AmapLocationFluttifyIOSAs<AMapGeoFenceRegion>(it)).where((e) => e != null).cast<AMapGeoFenceRegion>().toList(), args['customID'], AmapLocationFluttifyIOSAs<NSError>(args['error']));
break;
case 'amapGeoFenceManager_didGeoFencesStatusChangedForRegion_customID_error':
// print log
if (fluttifyLogEnabled) {
debugPrint('fluttify-dart-callback: __object__.amapGeoFenceManager_didGeoFencesStatusChangedForRegion_customID_error?.call([\'manager\':${args['manager']}, \'region\':${args['region']}, \'customID\':${args['customID']}, \'error\':${args['error']}])');
}
// handle the native call
__object__.amapGeoFenceManager_didGeoFencesStatusChangedForRegion_customID_error?.call(AmapLocationFluttifyIOSAs<AMapGeoFenceManager>(args['manager']), AmapLocationFluttifyIOSAs<AMapGeoFenceRegion>(args['region']), args['customID'], AmapLocationFluttifyIOSAs<NSError>(args['error']));
break;
default:
throw MissingPluginException('方法${methodCall.method}未实现');
break;
}
} catch (e) {
debugPrint(e.toString());
rethrow;
}
});
return __object__;
}