// 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_map_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';
import 'package:amap_search_fluttify/amap_search_fluttify.dart';
import 'package:amap_location_fluttify/amap_location_fluttify.dart';

class MAPolygon extends MAMultiPoint with MAAnnotation, MAOverlay {
  //region constants
  static const String name__ = 'MAPolygon';

  @override
  final String tag__ = 'amap_map_fluttify';

  
  //endregion

  //region creators
  static Future<MAPolygon> create__({ bool init = true /* ios only */ }) async {
    final __result__ = await kAmapMapFluttifyChannel.invokeMethod(
      'ObjectFactory::createMAPolygon',
      {'init': init}
    );
    return AmapMapFluttifyIOSAs<MAPolygon>(__result__)!;
  }
  
  static Future<List<MAPolygon>> create_batch__(int length, { bool init = true /* ios only */ }) async {
    assert(true);
    final __result_batch__ = await  kAmapMapFluttifyChannel.invokeListMethod(
      'ObjectFactory::create_batchMAPolygon',
      {'length': length, 'init': init}
    );
    return __result_batch__
        ?.map((it) => AmapMapFluttifyIOSAs<MAPolygon>(it))
        .where((element) => element !=null)
        .cast<MAPolygon>()
        .toList() ?? <MAPolygon>[];
  }
  
  //endregion

  //region getters
  
  //endregion

  //region setters
  
  //endregion

  //region methods
  
  static Future<MAPolygon?> polygonWithCoordinates_count(List<CLLocationCoordinate2D>? coords, int? count) async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: MAPolygon::polygonWithCoordinates([\'count\':$count])');
    }
  
    // invoke native method
    final __result__ = await kAmapMapFluttifyChannel.invokeMethod('MAPolygon::polygonWithCoordinates_count', {"coords": coords, "count": count});
  
  
    // handle native call
  
  
    return AmapMapFluttifyIOSAs<MAPolygon>(__result__);
  }
  
  
  static Future<MAPolygon?> polygonWithPoints_count(List<MAMapPoint>? points, int? count) async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: MAPolygon::polygonWithPoints([\'count\':$count])');
    }
  
    // invoke native method
    final __result__ = await kAmapMapFluttifyChannel.invokeMethod('MAPolygon::polygonWithPoints_count', {"points": points, "count": count});
  
  
    // handle native call
  
  
    return AmapMapFluttifyIOSAs<MAPolygon>(__result__);
  }
  
  
  Future<bool?> setPolygonWithPoints_count(List<MAMapPoint>? points, int? count) async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: MAPolygon@$refId::setPolygonWithPoints([\'count\':$count])');
    }
  
    // invoke native method
    final __result__ = await kAmapMapFluttifyChannel.invokeMethod('MAPolygon::setPolygonWithPoints_count', {"points": points, "count": count, "__this__": this});
  
  
    // handle native call
  
  
    return __result__;
  }
  
  
  Future<bool?> setPolygonWithCoordinates_count(List<CLLocationCoordinate2D>? coords, int? count) async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: MAPolygon@$refId::setPolygonWithCoordinates([\'count\':$count])');
    }
  
    // invoke native method
    final __result__ = await kAmapMapFluttifyChannel.invokeMethod('MAPolygon::setPolygonWithCoordinates_count', {"coords": coords, "count": count, "__this__": this});
  
  
    // handle native call
  
  
    return __result__;
  }
  
  //endregion

  @override
  String toString() {
    return 'MAPolygon{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}';
  }
}

extension MAPolygon_Batch on List<MAPolygon?> {
  String? get refId {
    if (isEmpty) return null;
    return first?.refId;
  }

  //region getters
  
  //endregion

  //region setters
  
  //endregion

  //region methods
  
  static Future<List<MAPolygon?>> polygonWithCoordinates_count_batch(List<List<CLLocationCoordinate2D>?> coords, List<int?> count) async {
    assert(coords.length == count.length);
  
    // invoke native method
    final resultBatch = await kAmapMapFluttifyChannel.invokeMethod('MAPolygon::polygonWithCoordinates_count_batch', [for (int __i__ = 0; __i__ < coords.length; __i__++) {"coords": coords[__i__], "count": count[__i__]}]);
  
  
    return (resultBatch as List).map((__result__) => AmapMapFluttifyIOSAs<MAPolygon>(__result__)).cast<MAPolygon?>().toList();
  }
  
  
  static Future<List<MAPolygon?>> polygonWithPoints_count_batch(List<List<MAMapPoint>?> points, List<int?> count) async {
    assert(points.length == count.length);
  
    // invoke native method
    final resultBatch = await kAmapMapFluttifyChannel.invokeMethod('MAPolygon::polygonWithPoints_count_batch', [for (int __i__ = 0; __i__ < points.length; __i__++) {"points": points[__i__], "count": count[__i__]}]);
  
  
    return (resultBatch as List).map((__result__) => AmapMapFluttifyIOSAs<MAPolygon>(__result__)).cast<MAPolygon?>().toList();
  }
  
  
  Future<List<bool?>> setPolygonWithPoints_count_batch(List<List<MAMapPoint>?> points, List<int?> count) async {
    assert(points.length == count.length);
  
    // invoke native method
    final resultBatch = await kAmapMapFluttifyChannel.invokeMethod('MAPolygon::setPolygonWithPoints_count_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"points": points[__i__], "count": count[__i__], "__this__": this[__i__]}]);
  
  
    return (resultBatch as List).map((__result__) => __result__).cast<bool?>().toList();
  }
  
  
  Future<List<bool?>> setPolygonWithCoordinates_count_batch(List<List<CLLocationCoordinate2D>?> coords, List<int?> count) async {
    assert(coords.length == count.length);
  
    // invoke native method
    final resultBatch = await kAmapMapFluttifyChannel.invokeMethod('MAPolygon::setPolygonWithCoordinates_count_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"coords": coords[__i__], "count": count[__i__], "__this__": this[__i__]}]);
  
  
    return (resultBatch as List).map((__result__) => __result__).cast<bool?>().toList();
  }
  
  //endregion
}