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

  @override
  final String tag__ = 'amap_map_fluttify';

  
  //endregion

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

  //region getters
  Future<bool?> get_updating() async {
    final __result__ = await kAmapMapFluttifyChannel.invokeMethod("MAUserLocation::get_isUpdating", {'__this__': this});
    return __result__;
  }
  
  Future<CLLocation?> get_location() async {
    final __result__ = await kAmapMapFluttifyChannel.invokeMethod("MAUserLocation::get_location", {'__this__': this});
    return AmapMapFluttifyIOSAs<CLLocation>(__result__);
  }
  
  Future<CLHeading?> get_heading() async {
    final __result__ = await kAmapMapFluttifyChannel.invokeMethod("MAUserLocation::get_heading", {'__this__': this});
    return AmapMapFluttifyIOSAs<CLHeading>(__result__);
  }
  
  //endregion

  //region setters
  
  //endregion

  //region methods
  
  //endregion

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

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

  //region getters
  Future<List<bool?>> get_updating_batch() async {
    final resultBatch = await kAmapMapFluttifyChannel.invokeMethod("MAUserLocation::get_isUpdating_batch", [for (final __item__ in this) {'__this__': __item__}]);
    return (resultBatch as List).map((__result__) => __result__).cast<bool?>().toList();
  }
  
  Future<List<CLLocation?>> get_location_batch() async {
    final resultBatch = await kAmapMapFluttifyChannel.invokeMethod("MAUserLocation::get_location_batch", [for (final __item__ in this) {'__this__': __item__}]);
    return (resultBatch as List).map((__result__) => AmapMapFluttifyIOSAs<CLLocation>(__result__)).cast<CLLocation?>().toList();
  }
  
  Future<List<CLHeading?>> get_heading_batch() async {
    final resultBatch = await kAmapMapFluttifyChannel.invokeMethod("MAUserLocation::get_heading_batch", [for (final __item__ in this) {'__this__': __item__}]);
    return (resultBatch as List).map((__result__) => AmapMapFluttifyIOSAs<CLHeading>(__result__)).cast<CLHeading?>().toList();
  }
  
  //endregion

  //region setters
  
  //endregion

  //region methods
  
  //endregion
}