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

  @override
  final String tag__ = 'amap_map_fluttify';

  
  //endregion

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

  //region getters
  Future<CGSize?> get_tileSize() async {
    final __result__ = await kAmapMapFluttifyChannel.invokeMethod("MATileOverlay::get_tileSize", {'__this__': this});
    return AmapMapFluttifyIOSAs<CGSize>(__result__);
  }
  
  Future<int?> get_minimumZ() async {
    final __result__ = await kAmapMapFluttifyChannel.invokeMethod("MATileOverlay::get_minimumZ", {'__this__': this});
    return __result__;
  }
  
  Future<int?> get_maximumZ() async {
    final __result__ = await kAmapMapFluttifyChannel.invokeMethod("MATileOverlay::get_maximumZ", {'__this__': this});
    return __result__;
  }
  
  Future<String?> get_URLTemplate() async {
    final __result__ = await kAmapMapFluttifyChannel.invokeMethod("MATileOverlay::get_URLTemplate", {'__this__': this});
    return __result__;
  }
  
  Future<bool?> get_canReplaceMapContent() async {
    final __result__ = await kAmapMapFluttifyChannel.invokeMethod("MATileOverlay::get_canReplaceMapContent", {'__this__': this});
    return __result__;
  }
  
  Future<bool?> get_disableOffScreenTileLoading() async {
    final __result__ = await kAmapMapFluttifyChannel.invokeMethod("MATileOverlay::get_disableOffScreenTileLoading", {'__this__': this});
    return __result__;
  }
  
  //endregion

  //region setters
  Future<void> set_tileSize(CGSize? tileSize) async {
    await kAmapMapFluttifyChannel.invokeMethod('MATileOverlay::set_tileSize', <String, dynamic>{'__this__': this, "tileSize": tileSize});
  }
  
  Future<void> set_minimumZ(int? minimumZ) async {
    await kAmapMapFluttifyChannel.invokeMethod('MATileOverlay::set_minimumZ', <String, dynamic>{'__this__': this, "minimumZ": minimumZ});
  }
  
  Future<void> set_maximumZ(int? maximumZ) async {
    await kAmapMapFluttifyChannel.invokeMethod('MATileOverlay::set_maximumZ', <String, dynamic>{'__this__': this, "maximumZ": maximumZ});
  }
  
  Future<void> set_canReplaceMapContent(bool? canReplaceMapContent) async {
    await kAmapMapFluttifyChannel.invokeMethod('MATileOverlay::set_canReplaceMapContent', <String, dynamic>{'__this__': this, "canReplaceMapContent": canReplaceMapContent});
  }
  
  Future<void> set_disableOffScreenTileLoading(bool? disableOffScreenTileLoading) async {
    await kAmapMapFluttifyChannel.invokeMethod('MATileOverlay::set_disableOffScreenTileLoading', <String, dynamic>{'__this__': this, "disableOffScreenTileLoading": disableOffScreenTileLoading});
  }
  
  //endregion

  //region methods
  
  Future<dynamic> initWithURLTemplate(String? URLTemplate) async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: MATileOverlay@$refId::initWithURLTemplate([\'URLTemplate\':$URLTemplate])');
    }
  
    // invoke native method
    final __result__ = await kAmapMapFluttifyChannel.invokeMethod('MATileOverlay::initWithURLTemplate', {"URLTemplate": URLTemplate, "__this__": this});
  
  
    // handle native call
  
  
    return __result__;
  }
  
  //endregion

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

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

  //region getters
  Future<List<CGSize?>> get_tileSize_batch() async {
    final resultBatch = await kAmapMapFluttifyChannel.invokeMethod("MATileOverlay::get_tileSize_batch", [for (final __item__ in this) {'__this__': __item__}]);
    return (resultBatch as List).map((__result__) => AmapMapFluttifyIOSAs<CGSize>(__result__)).cast<CGSize?>().toList();
  }
  
  Future<List<int?>> get_minimumZ_batch() async {
    final resultBatch = await kAmapMapFluttifyChannel.invokeMethod("MATileOverlay::get_minimumZ_batch", [for (final __item__ in this) {'__this__': __item__}]);
    return (resultBatch as List).map((__result__) => __result__).cast<int?>().toList();
  }
  
  Future<List<int?>> get_maximumZ_batch() async {
    final resultBatch = await kAmapMapFluttifyChannel.invokeMethod("MATileOverlay::get_maximumZ_batch", [for (final __item__ in this) {'__this__': __item__}]);
    return (resultBatch as List).map((__result__) => __result__).cast<int?>().toList();
  }
  
  Future<List<String?>> get_URLTemplate_batch() async {
    final resultBatch = await kAmapMapFluttifyChannel.invokeMethod("MATileOverlay::get_URLTemplate_batch", [for (final __item__ in this) {'__this__': __item__}]);
    return (resultBatch as List).map((__result__) => __result__).cast<String?>().toList();
  }
  
  Future<List<bool?>> get_canReplaceMapContent_batch() async {
    final resultBatch = await kAmapMapFluttifyChannel.invokeMethod("MATileOverlay::get_canReplaceMapContent_batch", [for (final __item__ in this) {'__this__': __item__}]);
    return (resultBatch as List).map((__result__) => __result__).cast<bool?>().toList();
  }
  
  Future<List<bool?>> get_disableOffScreenTileLoading_batch() async {
    final resultBatch = await kAmapMapFluttifyChannel.invokeMethod("MATileOverlay::get_disableOffScreenTileLoading_batch", [for (final __item__ in this) {'__this__': __item__}]);
    return (resultBatch as List).map((__result__) => __result__).cast<bool?>().toList();
  }
  
  //endregion

  //region setters
  Future<void> set_tileSize_batch(List<CGSize?> tileSize) async {
    await kAmapMapFluttifyChannel.invokeMethod('MATileOverlay::set_tileSize_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "tileSize": tileSize[__i__]}]);
  
  
  }
  
  Future<void> set_minimumZ_batch(List<int?> minimumZ) async {
    await kAmapMapFluttifyChannel.invokeMethod('MATileOverlay::set_minimumZ_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "minimumZ": minimumZ[__i__]}]);
  
  
  }
  
  Future<void> set_maximumZ_batch(List<int?> maximumZ) async {
    await kAmapMapFluttifyChannel.invokeMethod('MATileOverlay::set_maximumZ_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "maximumZ": maximumZ[__i__]}]);
  
  
  }
  
  Future<void> set_canReplaceMapContent_batch(List<bool?> canReplaceMapContent) async {
    await kAmapMapFluttifyChannel.invokeMethod('MATileOverlay::set_canReplaceMapContent_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "canReplaceMapContent": canReplaceMapContent[__i__]}]);
  
  
  }
  
  Future<void> set_disableOffScreenTileLoading_batch(List<bool?> disableOffScreenTileLoading) async {
    await kAmapMapFluttifyChannel.invokeMethod('MATileOverlay::set_disableOffScreenTileLoading_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "disableOffScreenTileLoading": disableOffScreenTileLoading[__i__]}]);
  
  
  }
  
  //endregion

  //region methods
  
  Future<List<dynamic>> initWithURLTemplate_batch(List<String?> URLTemplate) async {
    assert(true);
  
    // invoke native method
    final resultBatch = await kAmapMapFluttifyChannel.invokeMethod('MATileOverlay::initWithURLTemplate_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"URLTemplate": URLTemplate[__i__], "__this__": this[__i__]}]);
  
  
    return (resultBatch as List).map((__result__) => __result__).cast<dynamic>().toList();
  }
  
  //endregion
}