// 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:tencent_live_fluttify/src/ios/ios.export.g.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

import 'package:foundation_fluttify/foundation_fluttify.dart';

class TXPreviewParam extends NSObject  {
  //region constants
  static const String name__ = 'TXPreviewParam';

  
  //endregion

  //region creators
  static Future<TXPreviewParam> create__({ bool init = true /* ios only */ }) async {
    final refId = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('ObjectFactory::createTXPreviewParam', {'init': init});
    final object = TXPreviewParam()..refId = refId..tag__ = 'tencent_live_fluttify';
    return object;
  }
  
  static Future<List<TXPreviewParam>> create_batch__(int length, { bool init = true /* ios only */ }) async {
    if (false) {
      return Future.error('all args must have same length!');
    }
    final List resultBatch = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('ObjectFactory::create_batchTXPreviewParam', {'length': length, 'init': init});
  
    final List<TXPreviewParam> typedResult = resultBatch.map((result) => TXPreviewParam()..refId = result..tag__ = 'tencent_live_fluttify').toList();
    return typedResult;
  }
  
  //endregion

  //region getters
  Future<UIView> get_videoView() async {
    final __result__ = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod("TXPreviewParam::get_videoView", {'__this__': this});
    return __result__ == null ? null : (UIView()..refId = __result__..tag__ = 'tencent_live_fluttify');
  }
  
  Future<TXPreviewRenderMode> get_renderMode() async {
    final __result__ = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod("TXPreviewParam::get_renderMode", {'__this__': this});
    return __result__ == null ? null : ((__result__ as int).toTXPreviewRenderMode());
  }
  
  //endregion

  //region setters
  Future<void> set_videoView(UIView videoView) async {
    await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('TXPreviewParam::set_videoView', <String, dynamic>{'__this__': this, "videoView": videoView});
  
  
  }
  
  Future<void> set_renderMode(TXPreviewRenderMode renderMode) async {
    await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('TXPreviewParam::set_renderMode', <String, dynamic>{'__this__': this, "renderMode": renderMode.toValue()});
  
  
  }
  
  //endregion

  //region methods
  
  //endregion
}

extension TXPreviewParam_Batch on List<TXPreviewParam> {
  //region getters
  Future<List<UIView>> get_videoView_batch() async {
    final resultBatch = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod("TXPreviewParam::get_videoView_batch", [for (final __item__ in this) {'__this__': __item__}]);
  
    final typedResult = (resultBatch as List).cast<String>().map((__result__) => UIView()..refId = __result__..tag__ = 'tencent_live_fluttify').toList();
    return typedResult;
  }
  
  Future<List<TXPreviewRenderMode>> get_renderMode_batch() async {
    final resultBatch = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod("TXPreviewParam::get_renderMode_batch", [for (final __item__ in this) {'__this__': __item__}]);
  
    final typedResult = (resultBatch as List).cast<String>().map((__result__) => (__result__ as int).toTXPreviewRenderMode()).toList();
    return typedResult;
  }
  
  //endregion

  //region setters
  Future<void> set_videoView_batch(List<UIView> videoView) async {
    await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec())).invokeMethod('TXPreviewParam::set_videoView_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "videoView": videoView[__i__]}]);
  
  
  }
  
  Future<void> set_renderMode_batch(List<TXPreviewRenderMode> renderMode) async {
    await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec())).invokeMethod('TXPreviewParam::set_renderMode_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "renderMode": renderMode[__i__].toValue()}]);
  
  
  }
  
  //endregion

  //region methods
  
  //endregion
}