Context.fromFrame constructor Null safety

Context.fromFrame(
  1. DynamicLibrary dll_handle,
  2. Uint8List data,
  3. int width,
  4. int height,
  5. ContextFormat format,
  6. int baseAngle
)

Implementation

Context.fromFrame(
    DynamicLibrary dll_handle, Uint8List data, int width, int height, ContextFormat format, int baseAngle)
    : super(dll_handle, nullptr) {
  var constructor = dll_handle.lookupFunction<_Context_CreateFromFrame_c, _Context_CreateFromFrame_dart>(
      _context_namespace + "createFromFrame");

  var exception = _getException();
  Pointer<Uint8> dataPointer = malloc.allocate<Uint8>(data.length);
  dataPointer.asTypedList(data.length).setAll(0, data);

  final newImpl = constructor(dataPointer, width, height, format.index, baseAngle, exception);

  tdvCheckException(exception, _dll_handle);

  this._impl = newImpl;

  malloc.free(dataPointer);
}