AMapCoordinateConvert function

Future<CLLocationCoordinate2D> AMapCoordinateConvert(
  1. CLLocationCoordinate2D coordinate,
  2. AMapCoordinateType type
)

Implementation

Future<CLLocationCoordinate2D> AMapCoordinateConvert(CLLocationCoordinate2D coordinate, AMapCoordinateType type) async {
  // print log
  if (!kReleaseMode) {
    print('fluttify-dart: AMapCoordinateConvert::AMapCoordinateConvert([])');
  }

  // invoke native method
  final result = await MethodChannel('me.yohom/amap_core_fluttify').invokeMethod('AMapCoordinateConvert::AMapCoordinateConvert', {"coordinate": coordinate.refId, "type": type.index});


  // handle native call


  // convert native result to dart side object
  if (result == null) {
    return null;
  } else {
    kNativeObjectPool.add(CLLocationCoordinate2D()..refId = result..tag = 'amap_core_fluttify');
    return CLLocationCoordinate2D()..refId = result..tag = 'amap_core_fluttify';
  }
}