// 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 MAOfflineItemCommonCity extends MAOfflineCity  {
  //region constants
  static const String name__ = 'MAOfflineItemCommonCity';

  @override
  final String tag__ = 'amap_map_fluttify';

  
  //endregion

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

  //region getters
  Future<MAOfflineItem?> get_province() async {
    final __result__ = await kAmapMapFluttifyChannel.invokeMethod("MAOfflineItemCommonCity::get_province", {'__this__': this});
    return AmapMapFluttifyIOSAs<MAOfflineItem>(__result__);
  }
  
  //endregion

  //region setters
  Future<void> set_province(MAOfflineItem? province) async {
    await kAmapMapFluttifyChannel.invokeMethod('MAOfflineItemCommonCity::set_province', <String, dynamic>{'__this__': this, "province": province});
  }
  
  //endregion

  //region methods
  
  //endregion

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

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

  //region getters
  Future<List<MAOfflineItem?>> get_province_batch() async {
    final resultBatch = await kAmapMapFluttifyChannel.invokeMethod("MAOfflineItemCommonCity::get_province_batch", [for (final __item__ in this) {'__this__': __item__}]);
    return (resultBatch as List).map((__result__) => AmapMapFluttifyIOSAs<MAOfflineItem>(__result__)).cast<MAOfflineItem?>().toList();
  }
  
  //endregion

  //region setters
  Future<void> set_province_batch(List<MAOfflineItem?> province) async {
    await kAmapMapFluttifyChannel.invokeMethod('MAOfflineItemCommonCity::set_province_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "province": province[__i__]}]);
  
  
  }
  
  //endregion

  //region methods
  
  //endregion
}