invoke<T> static method

Future<T?> invoke<T>(
  1. String method, [
  2. Map<String, Object?>? arguments
])

Implementation

static Future<T?> invoke<T>(String method, [Map<String, Object?>? arguments]) async {
  try {
    return await _channel.invokeMethod<T>(method, arguments);
  } on PlatformException catch (error) {
    throw UCameraException.fromPlatform(error);
  } on MissingPluginException {
    throw const UCameraException(code: UCameraErrorCode.unsupported, message: "Camera is not available on this platform");
  } on UCameraException {
    rethrow;
  } catch (error) {
    throw UCameraException(code: UCameraErrorCode.unknown, message: "$error");
  }
}