// 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 MAParticleRandomColorGenerate extends NSObject with MAParticleColorGenerate {
  //region constants
  static const String name__ = 'MAParticleRandomColorGenerate';

  @override
  final String tag__ = 'amap_map_fluttify';

  
  //endregion

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

  //region getters
  
  //endregion

  //region setters
  
  //endregion

  //region methods
  
  Future<MAParticleRandomColorGenerate?> initWithBoundaryColorR1_G1_B1_A1_R2_G2_B2_A2(double? r1, double? g1, double? b1, double? a1, double? r2, double? g2, double? b2, double? a2) async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: MAParticleRandomColorGenerate@$refId::initWithBoundaryColorR1([\'r1\':$r1, \'g1\':$g1, \'b1\':$b1, \'a1\':$a1, \'r2\':$r2, \'g2\':$g2, \'b2\':$b2, \'a2\':$a2])');
    }
  
    // invoke native method
    final __result__ = await kAmapMapFluttifyChannel.invokeMethod('MAParticleRandomColorGenerate::initWithBoundaryColorR1_G1_B1_A1_R2_G2_B2_A2', {"r1": r1, "g1": g1, "b1": b1, "a1": a1, "r2": r2, "g2": g2, "b2": b2, "a2": a2, "__this__": this});
  
  
    // handle native call
  
  
    return AmapMapFluttifyIOSAs<MAParticleRandomColorGenerate>(__result__);
  }
  
  //endregion

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

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

  //region getters
  
  //endregion

  //region setters
  
  //endregion

  //region methods
  
  Future<List<MAParticleRandomColorGenerate?>> initWithBoundaryColorR1_G1_B1_A1_R2_G2_B2_A2_batch(List<double?> r1, List<double?> g1, List<double?> b1, List<double?> a1, List<double?> r2, List<double?> g2, List<double?> b2, List<double?> a2) async {
    assert(r1.length == g1.length && g1.length == b1.length && b1.length == a1.length && a1.length == r2.length && r2.length == g2.length && g2.length == b2.length && b2.length == a2.length);
  
    // invoke native method
    final resultBatch = await kAmapMapFluttifyChannel.invokeMethod('MAParticleRandomColorGenerate::initWithBoundaryColorR1_G1_B1_A1_R2_G2_B2_A2_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"r1": r1[__i__], "g1": g1[__i__], "b1": b1[__i__], "a1": a1[__i__], "r2": r2[__i__], "g2": g2[__i__], "b2": b2[__i__], "a2": a2[__i__], "__this__": this[__i__]}]);
  
  
    return (resultBatch as List).map((__result__) => AmapMapFluttifyIOSAs<MAParticleRandomColorGenerate>(__result__)).cast<MAParticleRandomColorGenerate?>().toList();
  }
  
  //endregion
}