// 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:core_location_fluttify/core_location_fluttify.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'package:foundation_fluttify/foundation_fluttify.dart';

class MALonLatPoint extends NSObject {
  static const String name__ = 'MALonLatPoint';

  @override
  final String tag__ = 'amap_map_fluttify';

  static Future<MALonLatPoint> create__({bool init = true}) async {
    final __result__ = await kAmapMapFluttifyChannel
        .invokeMethod('ObjectFactory::createMALonLatPoint', {'init': init});
    return MALonLatPoint()..refId = __result__.refId;
  }

  static Future<List<MALonLatPoint>> create_batch__(
    int length, {
    bool init = true,
  }) async {
    final List resultBatch = await kAmapMapFluttifyChannel.invokeMethod(
      'ObjectFactory::create_batchMALonLatPoint',
      {'length': length, 'init': init},
    );
    return resultBatch.map((e) => MALonLatPoint()..refId = e.refId).toList();
  }

  Future<double> get_lat() async {
    return await kAmapMapFluttifyChannel
            .invokeMethod("MALonLatPoint::get_lat", {'__this__': this}) ??
        0;
  }

  Future<double> get_lon() async {
    return await kAmapMapFluttifyChannel
            .invokeMethod("MALonLatPoint::get_lon", {'__this__': this}) ??
        0;
  }

  Future<void> set_lat(double lat) async {
    await kAmapMapFluttifyChannel.invokeMethod('MALonLatPoint::set_lat',
        <String, dynamic>{'__this__': this, "lat": lat});
  }

  Future<void> set_lon(double lon) async {
    await kAmapMapFluttifyChannel.invokeMethod('MALonLatPoint::set_lon',
        <String, dynamic>{'__this__': this, "lon": lon});
  }
}

extension MALonLatPoint_Batch on List<MALonLatPoint> {
  //region getters
  Future<List<double>> get_lat_batch() async {
    final resultBatch = await kAmapMapFluttifyChannel.invokeMethod(
      "MALonLatPoint::get_lat_batch",
      [
        for (final __item__ in this) {'__this__': __item__}
      ],
    );
    return (resultBatch as List).cast<double>();
  }

  Future<List<double>> get_lon_batch() async {
    final resultBatch = await kAmapMapFluttifyChannel.invokeMethod(
      "MALonLatPoint::get_lon_batch",
      [
        for (final __item__ in this) {'__this__': __item__}
      ],
    );
    return (resultBatch as List).cast<double>();
  }

  //endregion

  //region setters
  Future<void> set_lat_batch(List<double> lat) async {
    await kAmapMapFluttifyChannel.invokeMethod('MALonLatPoint::set_lat_batch', [
      for (int __i__ = 0; __i__ < this.length; __i__++)
        {'__this__': this[__i__], "lat": lat[__i__]}
    ]);
  }

  Future<void> set_lon_batch(List<double> lon) async {
    await kAmapMapFluttifyChannel.invokeMethod('MALonLatPoint::set_lon_batch', [
      for (int __i__ = 0; __i__ < this.length; __i__++)
        {'__this__': this[__i__], "lon": lon[__i__]}
    ]);
  }
}
