// 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 MAPolyline extends MAMultiPoint with MAAnnotation, MAOverlay {
  //region constants
  static const String name__ = 'MAPolyline';

  @override
  final String tag__ = 'amap_map_fluttify';

  
  //endregion

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

  //region getters
  
  //endregion

  //region setters
  
  //endregion

  //region methods
  
  static Future<MAPolyline?> polylineWithPoints_count(List<MAMapPoint>? points, int? count) async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: MAPolyline::polylineWithPoints([\'count\':$count])');
    }
  
    // invoke native method
    final __result__ = await kAmapMapFluttifyChannel.invokeMethod('MAPolyline::polylineWithPoints_count', {"points": points, "count": count});
  
  
    // handle native call
  
  
    return AmapMapFluttifyIOSAs<MAPolyline>(__result__);
  }
  
  
  static Future<MAPolyline?> polylineWithCoordinates_count(List<CLLocationCoordinate2D>? coords, int? count) async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: MAPolyline::polylineWithCoordinates([\'count\':$count])');
    }
  
    // invoke native method
    final __result__ = await kAmapMapFluttifyChannel.invokeMethod('MAPolyline::polylineWithCoordinates_count', {"coords": coords, "count": count});
  
  
    // handle native call
  
  
    return AmapMapFluttifyIOSAs<MAPolyline>(__result__);
  }
  
  
  Future<bool?> setPolylineWithPoints_count(List<MAMapPoint>? points, int? count) async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: MAPolyline@$refId::setPolylineWithPoints([\'count\':$count])');
    }
  
    // invoke native method
    final __result__ = await kAmapMapFluttifyChannel.invokeMethod('MAPolyline::setPolylineWithPoints_count', {"points": points, "count": count, "__this__": this});
  
  
    // handle native call
  
  
    return __result__;
  }
  
  
  Future<bool?> setPolylineWithCoordinates_count(List<CLLocationCoordinate2D>? coords, int? count) async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: MAPolyline@$refId::setPolylineWithCoordinates([\'count\':$count])');
    }
  
    // invoke native method
    final __result__ = await kAmapMapFluttifyChannel.invokeMethod('MAPolyline::setPolylineWithCoordinates_count', {"coords": coords, "count": count, "__this__": this});
  
  
    // handle native call
  
  
    return __result__;
  }
  
  //endregion

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

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

  //region getters
  
  //endregion

  //region setters
  
  //endregion

  //region methods
  
  static Future<List<MAPolyline?>> polylineWithPoints_count_batch(List<List<MAMapPoint>?> points, List<int?> count) async {
    assert(points.length == count.length);
  
    // invoke native method
    final resultBatch = await kAmapMapFluttifyChannel.invokeMethod('MAPolyline::polylineWithPoints_count_batch', [for (int __i__ = 0; __i__ < points.length; __i__++) {"points": points[__i__], "count": count[__i__]}]);
  
  
    return (resultBatch as List).map((__result__) => AmapMapFluttifyIOSAs<MAPolyline>(__result__)).cast<MAPolyline?>().toList();
  }
  
  
  static Future<List<MAPolyline?>> polylineWithCoordinates_count_batch(List<List<CLLocationCoordinate2D>?> coords, List<int?> count) async {
    assert(coords.length == count.length);
  
    // invoke native method
    final resultBatch = await kAmapMapFluttifyChannel.invokeMethod('MAPolyline::polylineWithCoordinates_count_batch', [for (int __i__ = 0; __i__ < coords.length; __i__++) {"coords": coords[__i__], "count": count[__i__]}]);
  
  
    return (resultBatch as List).map((__result__) => AmapMapFluttifyIOSAs<MAPolyline>(__result__)).cast<MAPolyline?>().toList();
  }
  
  
  Future<List<bool?>> setPolylineWithPoints_count_batch(List<List<MAMapPoint>?> points, List<int?> count) async {
    assert(points.length == count.length);
  
    // invoke native method
    final resultBatch = await kAmapMapFluttifyChannel.invokeMethod('MAPolyline::setPolylineWithPoints_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?>> setPolylineWithCoordinates_count_batch(List<List<CLLocationCoordinate2D>?> coords, List<int?> count) async {
    assert(coords.length == count.length);
  
    // invoke native method
    final resultBatch = await kAmapMapFluttifyChannel.invokeMethod('MAPolyline::setPolylineWithCoordinates_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
}