createInstance method

  1. @override
$CaptureDeviceDiscoverySession createInstance(
  1. TypeChannelMessenger messenger,
  2. List<Object?> arguments
)
override

Instantiates a new object with arguments.

Implementation

@override
$CaptureDeviceDiscoverySession createInstance(
  TypeChannelMessenger messenger,
  List<Object?> arguments,
) {
  final String constructorName = arguments[0] as String;
  switch (constructorName) {
    case '':
      return $create$(
        messenger,
        (arguments[1] as List<dynamic>)
            .map((_) => _ as $CaptureDevice)
            .toList(),
        (arguments[2] as List<dynamic>)
            .map((_) =>
                (_ as List<dynamic>).map((_) => _ as $CaptureDevice).toList())
            .toList(),
      );
  }

  throw ArgumentError.value(
    constructorName,
    'constructorName',
    'Unable to invoke constructor of',
  );
}