newLinkRefBuilder method

RefDetailsBuilder newLinkRefBuilder(
  1. String title,
  2. String uri
)

create a link ref builder

Implementation

RefDetailsBuilder newLinkRefBuilder(
  String title,
  String uri,
) {
  final tmp0 = title;
  final tmp4 = uri;
  var tmp1 = 0;
  var tmp2 = 0;
  var tmp3 = 0;
  var tmp5 = 0;
  var tmp6 = 0;
  var tmp7 = 0;
  final tmp0_0 = utf8.encode(tmp0);
  tmp2 = tmp0_0.length;

  final ffi.Pointer<ffi.Uint8> tmp1_0 = this.__allocate(tmp2 * 1, 1);
  final Uint8List tmp1_1 = tmp1_0.asTypedList(tmp2);
  tmp1_1.setAll(0, tmp0_0);
  tmp1 = tmp1_0.address;
  tmp3 = tmp2;
  final tmp4_0 = utf8.encode(tmp4);
  tmp6 = tmp4_0.length;

  final ffi.Pointer<ffi.Uint8> tmp5_0 = this.__allocate(tmp6 * 1, 1);
  final Uint8List tmp5_1 = tmp5_0.asTypedList(tmp6);
  tmp5_1.setAll(0, tmp4_0);
  tmp5 = tmp5_0.address;
  tmp7 = tmp6;
  final tmp8 = _newLinkRefBuilder(
    tmp1,
    tmp2,
    tmp3,
    tmp5,
    tmp6,
    tmp7,
  );
  final tmp10 = tmp8.arg0;
  final tmp11 = tmp8.arg1;
  final tmp12 = tmp8.arg2;
  final tmp13 = tmp8.arg3;
  final tmp14 = tmp8.arg4;
  if (tmp10 == 0) {
    debugAllocation("handle error", tmp11, tmp12);
    final ffi.Pointer<ffi.Uint8> tmp11_0 = ffi.Pointer.fromAddress(tmp11);
    final tmp10_0 =
        utf8.decode(tmp11_0.asTypedList(tmp12), allowMalformed: true);
    if (tmp12 > 0) {
      final ffi.Pointer<ffi.Void> tmp11_0;
      tmp11_0 = ffi.Pointer.fromAddress(tmp11);
      this.__deallocate(tmp11_0, tmp13, 1);
    }
    throw tmp10_0;
  }
  final ffi.Pointer<ffi.Void> tmp14_0 = ffi.Pointer.fromAddress(tmp14);
  final tmp14_1 = _Box(this, tmp14_0, "drop_box_RefDetailsBuilder");
  tmp14_1._finalizer = this._registerFinalizer(tmp14_1);
  final tmp9 = RefDetailsBuilder._(this, tmp14_1);
  return tmp9;
}