// ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast
//////////////////////////////////////////////////////////
// GENERATED BY FLUTTIFY. DO NOT EDIT IT.
//////////////////////////////////////////////////////////

import 'dart:typed_data';

import 'package:amap_search_fluttify/src/ios/ios.export.g.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

import 'package:foundation_fluttify/foundation_fluttify.dart';
import 'package:core_location_fluttify/core_location_fluttify.dart';
import 'package:amap_core_fluttify/amap_core_fluttify.dart';

class _AMapSearchDelegate_SUB extends NSObject with AMapSearchDelegate {}

mixin AMapSearchDelegate on NSObject {
  

  static AMapSearchDelegate subInstance() => _AMapSearchDelegate_SUB();

  static Future<AMapSearchDelegate> anonymous__() async {
    final __result__ = await kAmapSearchFluttifyChannel.invokeMethod('AMapSearchDelegate::createAnonymous__');
  
    final __object__ = AmapSearchFluttifyIOSAs<AMapSearchDelegate>(__result__)!;
  
    // handle callback
    MethodChannel('AMapSearchDelegate::Callback@${__object__.refId}', kAmapSearchFluttifyMethodCodec)
        .setMethodCallHandler((methodCall) async {
          try {
            final args = methodCall.arguments as Map;
            switch (methodCall.method) {
              case 'AMapSearchRequest_didFailWithError':
                // print log
                if (fluttifyLogEnabled) {
                  debugPrint('fluttify-dart-callback: __object__.AMapSearchRequest_didFailWithError?.call([\'request\':${args['request']}, \'error\':${args['error']}])');
                }
            
                // handle the native call
                __object__.AMapSearchRequest_didFailWithError?.call(AmapSearchFluttifyIOSAs<dynamic>(args['request']), AmapSearchFluttifyIOSAs<NSError>(args['error']));
                break;
              case 'onPOISearchDone_response':
                // print log
                if (fluttifyLogEnabled) {
                  debugPrint('fluttify-dart-callback: __object__.onPOISearchDone_response?.call([\'request\':${args['request']}, \'response\':${args['response']}])');
                }
            
                // handle the native call
                __object__.onPOISearchDone_response?.call(AmapSearchFluttifyIOSAs<AMapPOISearchBaseRequest>(args['request']), AmapSearchFluttifyIOSAs<AMapPOISearchResponse>(args['response']));
                break;
              case 'onRoutePOISearchDone_response':
                // print log
                if (fluttifyLogEnabled) {
                  debugPrint('fluttify-dart-callback: __object__.onRoutePOISearchDone_response?.call([\'request\':${args['request']}, \'response\':${args['response']}])');
                }
            
                // handle the native call
                __object__.onRoutePOISearchDone_response?.call(AmapSearchFluttifyIOSAs<AMapRoutePOISearchRequest>(args['request']), AmapSearchFluttifyIOSAs<AMapRoutePOISearchResponse>(args['response']));
                break;
              case 'onGeocodeSearchDone_response':
                // print log
                if (fluttifyLogEnabled) {
                  debugPrint('fluttify-dart-callback: __object__.onGeocodeSearchDone_response?.call([\'request\':${args['request']}, \'response\':${args['response']}])');
                }
            
                // handle the native call
                __object__.onGeocodeSearchDone_response?.call(AmapSearchFluttifyIOSAs<AMapGeocodeSearchRequest>(args['request']), AmapSearchFluttifyIOSAs<AMapGeocodeSearchResponse>(args['response']));
                break;
              case 'onReGeocodeSearchDone_response':
                // print log
                if (fluttifyLogEnabled) {
                  debugPrint('fluttify-dart-callback: __object__.onReGeocodeSearchDone_response?.call([\'request\':${args['request']}, \'response\':${args['response']}])');
                }
            
                // handle the native call
                __object__.onReGeocodeSearchDone_response?.call(AmapSearchFluttifyIOSAs<AMapReGeocodeSearchRequest>(args['request']), AmapSearchFluttifyIOSAs<AMapReGeocodeSearchResponse>(args['response']));
                break;
              case 'onInputTipsSearchDone_response':
                // print log
                if (fluttifyLogEnabled) {
                  debugPrint('fluttify-dart-callback: __object__.onInputTipsSearchDone_response?.call([\'request\':${args['request']}, \'response\':${args['response']}])');
                }
            
                // handle the native call
                __object__.onInputTipsSearchDone_response?.call(AmapSearchFluttifyIOSAs<AMapInputTipsSearchRequest>(args['request']), AmapSearchFluttifyIOSAs<AMapInputTipsSearchResponse>(args['response']));
                break;
              case 'onBusStopSearchDone_response':
                // print log
                if (fluttifyLogEnabled) {
                  debugPrint('fluttify-dart-callback: __object__.onBusStopSearchDone_response?.call([\'request\':${args['request']}, \'response\':${args['response']}])');
                }
            
                // handle the native call
                __object__.onBusStopSearchDone_response?.call(AmapSearchFluttifyIOSAs<AMapBusStopSearchRequest>(args['request']), AmapSearchFluttifyIOSAs<AMapBusStopSearchResponse>(args['response']));
                break;
              case 'onBusLineSearchDone_response':
                // print log
                if (fluttifyLogEnabled) {
                  debugPrint('fluttify-dart-callback: __object__.onBusLineSearchDone_response?.call([\'request\':${args['request']}, \'response\':${args['response']}])');
                }
            
                // handle the native call
                __object__.onBusLineSearchDone_response?.call(AmapSearchFluttifyIOSAs<AMapBusLineBaseSearchRequest>(args['request']), AmapSearchFluttifyIOSAs<AMapBusLineSearchResponse>(args['response']));
                break;
              case 'onDistrictSearchDone_response':
                // print log
                if (fluttifyLogEnabled) {
                  debugPrint('fluttify-dart-callback: __object__.onDistrictSearchDone_response?.call([\'request\':${args['request']}, \'response\':${args['response']}])');
                }
            
                // handle the native call
                __object__.onDistrictSearchDone_response?.call(AmapSearchFluttifyIOSAs<AMapDistrictSearchRequest>(args['request']), AmapSearchFluttifyIOSAs<AMapDistrictSearchResponse>(args['response']));
                break;
              case 'onRouteSearchDone_response':
                // print log
                if (fluttifyLogEnabled) {
                  debugPrint('fluttify-dart-callback: __object__.onRouteSearchDone_response?.call([\'request\':${args['request']}, \'response\':${args['response']}])');
                }
            
                // handle the native call
                __object__.onRouteSearchDone_response?.call(AmapSearchFluttifyIOSAs<AMapRouteSearchBaseRequest>(args['request']), AmapSearchFluttifyIOSAs<AMapRouteSearchResponse>(args['response']));
                break;
              case 'onFutureRouteSearchDone_response':
                // print log
                if (fluttifyLogEnabled) {
                  debugPrint('fluttify-dart-callback: __object__.onFutureRouteSearchDone_response?.call([\'request\':${args['request']}, \'response\':${args['response']}])');
                }
            
                // handle the native call
                __object__.onFutureRouteSearchDone_response?.call(AmapSearchFluttifyIOSAs<AMapRouteSearchBaseRequest>(args['request']), AmapSearchFluttifyIOSAs<AMapFutureRouteSearchResponse>(args['response']));
                break;
              case 'onDistanceSearchDone_response':
                // print log
                if (fluttifyLogEnabled) {
                  debugPrint('fluttify-dart-callback: __object__.onDistanceSearchDone_response?.call([\'request\':${args['request']}, \'response\':${args['response']}])');
                }
            
                // handle the native call
                __object__.onDistanceSearchDone_response?.call(AmapSearchFluttifyIOSAs<AMapDistanceSearchRequest>(args['request']), AmapSearchFluttifyIOSAs<AMapDistanceSearchResponse>(args['response']));
                break;
              case 'onWeatherSearchDone_response':
                // print log
                if (fluttifyLogEnabled) {
                  debugPrint('fluttify-dart-callback: __object__.onWeatherSearchDone_response?.call([\'request\':${args['request']}, \'response\':${args['response']}])');
                }
            
                // handle the native call
                __object__.onWeatherSearchDone_response?.call(AmapSearchFluttifyIOSAs<AMapWeatherSearchRequest>(args['request']), AmapSearchFluttifyIOSAs<AMapWeatherSearchResponse>(args['response']));
                break;
              case 'onNearbySearchDone_response':
                // print log
                if (fluttifyLogEnabled) {
                  debugPrint('fluttify-dart-callback: __object__.onNearbySearchDone_response?.call([\'request\':${args['request']}, \'response\':${args['response']}])');
                }
            
                // handle the native call
                __object__.onNearbySearchDone_response?.call(AmapSearchFluttifyIOSAs<AMapNearbySearchRequest>(args['request']), AmapSearchFluttifyIOSAs<AMapNearbySearchResponse>(args['response']));
                break;
              case 'onCloudSearchDone_response':
                // print log
                if (fluttifyLogEnabled) {
                  debugPrint('fluttify-dart-callback: __object__.onCloudSearchDone_response?.call([\'request\':${args['request']}, \'response\':${args['response']}])');
                }
            
                // handle the native call
                __object__.onCloudSearchDone_response?.call(AmapSearchFluttifyIOSAs<AMapCloudSearchBaseRequest>(args['request']), AmapSearchFluttifyIOSAs<AMapCloudPOISearchResponse>(args['response']));
                break;
              case 'onShareSearchDone_response':
                // print log
                if (fluttifyLogEnabled) {
                  debugPrint('fluttify-dart-callback: __object__.onShareSearchDone_response?.call([\'request\':${args['request']}, \'response\':${args['response']}])');
                }
            
                // handle the native call
                __object__.onShareSearchDone_response?.call(AmapSearchFluttifyIOSAs<AMapShareSearchBaseRequest>(args['request']), AmapSearchFluttifyIOSAs<AMapShareSearchResponse>(args['response']));
                break;
              default:
                throw MissingPluginException('方法${methodCall.method}未实现');
                break;
            }
          } catch (e) {
            debugPrint(e.toString());
            rethrow;
          }
        });
  
    return __object__;
  }
  

  @override
  final String tag__ = 'amap_search_fluttify';

  

  

  Future<void> Function(dynamic request, NSError? error)? AMapSearchRequest_didFailWithError;
  
  Future<void> Function(AMapPOISearchBaseRequest? request, AMapPOISearchResponse? response)? onPOISearchDone_response;
  
  Future<void> Function(AMapRoutePOISearchRequest? request, AMapRoutePOISearchResponse? response)? onRoutePOISearchDone_response;
  
  Future<void> Function(AMapGeocodeSearchRequest? request, AMapGeocodeSearchResponse? response)? onGeocodeSearchDone_response;
  
  Future<void> Function(AMapReGeocodeSearchRequest? request, AMapReGeocodeSearchResponse? response)? onReGeocodeSearchDone_response;
  
  Future<void> Function(AMapInputTipsSearchRequest? request, AMapInputTipsSearchResponse? response)? onInputTipsSearchDone_response;
  
  Future<void> Function(AMapBusStopSearchRequest? request, AMapBusStopSearchResponse? response)? onBusStopSearchDone_response;
  
  Future<void> Function(AMapBusLineBaseSearchRequest? request, AMapBusLineSearchResponse? response)? onBusLineSearchDone_response;
  
  Future<void> Function(AMapDistrictSearchRequest? request, AMapDistrictSearchResponse? response)? onDistrictSearchDone_response;
  
  Future<void> Function(AMapRouteSearchBaseRequest? request, AMapRouteSearchResponse? response)? onRouteSearchDone_response;
  
  Future<void> Function(AMapRouteSearchBaseRequest? request, AMapFutureRouteSearchResponse? response)? onFutureRouteSearchDone_response;
  
  Future<void> Function(AMapDistanceSearchRequest? request, AMapDistanceSearchResponse? response)? onDistanceSearchDone_response;
  
  Future<void> Function(AMapWeatherSearchRequest? request, AMapWeatherSearchResponse? response)? onWeatherSearchDone_response;
  
  Future<void> Function(AMapNearbySearchRequest? request, AMapNearbySearchResponse? response)? onNearbySearchDone_response;
  
  Future<void> Function(AMapCloudSearchBaseRequest? request, AMapCloudPOISearchResponse? response)? onCloudSearchDone_response;
  
  Future<void> Function(AMapShareSearchBaseRequest? request, AMapShareSearchResponse? response)? onShareSearchDone_response;
  
}

