AmapLocationFluttifyIOSAs<T> function

  1. @optionalTypeArgs
T? AmapLocationFluttifyIOSAs<T>(
  1. dynamic __this__
)

Implementation

@optionalTypeArgs
T? AmapLocationFluttifyIOSAs<T>(dynamic __this__) {
  final typeName = T.toString();

  if (__this__ == null) {
    return null;
  } else if (RegExp(r'^(List<)?(String|int|double)(>)?|(Map<String,(String|int|double)>)$').hasMatch(typeName)) {
    return __this__ as T;
  }
  else if (T == AMapGeoFenceManager) {
    return (AMapGeoFenceManager()..refId = (__this__ as Ref).refId) as T;
  } else if (T == AMapGeoFenceManagerDelegate) {
    return (AMapGeoFenceManagerDelegate.subInstance()..refId = (__this__ as Ref).refId) as T;
  } else if (T == AMapLocationRegion) {
    return (AMapLocationRegion()..refId = (__this__ as Ref).refId) as T;
  } else if (T == AMapLocationCircleRegion) {
    return (AMapLocationCircleRegion()..refId = (__this__ as Ref).refId) as T;
  } else if (T == AMapLocationPolygonRegion) {
    return (AMapLocationPolygonRegion()..refId = (__this__ as Ref).refId) as T;
  } else if (T == AMapGeoFenceRegion) {
    return (AMapGeoFenceRegion()..refId = (__this__ as Ref).refId) as T;
  } else if (T == AMapGeoFenceCircleRegion) {
    return (AMapGeoFenceCircleRegion()..refId = (__this__ as Ref).refId) as T;
  } else if (T == AMapGeoFencePolygonRegion) {
    return (AMapGeoFencePolygonRegion()..refId = (__this__ as Ref).refId) as T;
  } else if (T == AMapGeoFencePOIRegion) {
    return (AMapGeoFencePOIRegion()..refId = (__this__ as Ref).refId) as T;
  } else if (T == AMapGeoFenceDistrictRegion) {
    return (AMapGeoFenceDistrictRegion()..refId = (__this__ as Ref).refId) as T;
  } else if (T == AMapLocationManager) {
    return (AMapLocationManager()..refId = (__this__ as Ref).refId) as T;
  } else if (T == AMapLocationManagerDelegate) {
    return (AMapLocationManagerDelegate.subInstance()..refId = (__this__ as Ref).refId) as T;
  } else if (T == AMapLocationReGeocode) {
    return (AMapLocationReGeocode()..refId = (__this__ as Ref).refId) as T;
  } else if (T == AMapLocationPoint) {
    return (AMapLocationPoint()..refId = (__this__ as Ref).refId) as T;
  } else if (T == AMapLocationPOIItem) {
    return (AMapLocationPOIItem()..refId = (__this__ as Ref).refId) as T;
  } else if (T == AMapLocationDistrictItem) {
    return (AMapLocationDistrictItem()..refId = (__this__ as Ref).refId) as T;
  } else if (T == CLLocation) {
    return (CLLocation()..refId = (__this__ as Ref).refId) as T;
  } else if (T == CLHeading) {
    return (CLHeading()..refId = (__this__ as Ref).refId) as T;
  } else if (T == CGRect) {
    return (CGRect()..refId = (__this__ as Ref).refId) as T;
  } else if (T == CGPoint) {
    return (CGPoint()..refId = (__this__ as Ref).refId) as T;
  } else if (T == CGSize) {
    return (CGSize()..refId = (__this__ as Ref).refId) as T;
  } else if (T == UIEdgeInsets) {
    return (UIEdgeInsets()..refId = (__this__ as Ref).refId) as T;
  } else if (T == CLLocationCoordinate2D) {
    return (CLLocationCoordinate2D()..refId = (__this__ as Ref).refId) as T;
  } else if (T == CLLocationManager) {
    return (CLLocationManager()..refId = (__this__ as Ref).refId) as T;
  } else if (T == NSError) {
    return (NSError()..refId = (__this__ as Ref).refId) as T;
  } else if (T == NSCoding) {
    return (NSCoding.subInstance()..refId = (__this__ as Ref).refId) as T;
  } else if (T == NSCopying) {
    return (NSCopying.subInstance()..refId = (__this__ as Ref).refId) as T;
  } else if (T == NSMutableCopying) {
    return (NSMutableCopying.subInstance()..refId = (__this__ as Ref).refId) as T;
  } else if (T == UIView) {
    return (UIView()..refId = (__this__ as Ref).refId) as T;
  } else if (T == UIViewController) {
    return (UIViewController()..refId = (__this__ as Ref).refId) as T;
  } else if (T == UIControl) {
    return (UIControl()..refId = (__this__ as Ref).refId) as T;
  } else if (T == UIImage) {
    return (UIImage()..refId = (__this__ as Ref).refId) as T;
  } else if (T == UIImageView) {
    return (UIImageView()..refId = (__this__ as Ref).refId) as T;
  } else if (T == UIColor) {
    return (UIColor()..refId = (__this__ as Ref).refId) as T;
  } else if (T == NSData) {
    return (NSData()..refId = (__this__ as Ref).refId) as T;
  } else if (T == NSDate) {
    return (NSDate()..refId = (__this__ as Ref).refId) as T;
  } else if (T == NSOperation) {
    return (NSOperation()..refId = (__this__ as Ref).refId) as T;
  }

  else {
    return __this__;
  }
}