allocate static method

Future<NativeTexture> allocate()

Implementation

static Future<NativeTexture> allocate() async {
  final int handle = CameraChannel.nextHandle++;

  final int? textureId = (await CameraChannel.channel.invokeMethod<int>(
    '$NativeTexture#allocate',
    <String, dynamic>{'textureHandle': handle},
  ));
  if (textureId == null) {
    throw CameraException('textureId', 'textureId is null');
  }

  return NativeTexture._(handle: handle, textureId: textureId);
}