setString function

void setString(
  1. String path,
  2. String value
)

ref(path).set(value) for a string value.

Returns once the write has been handed to the SDK. It does not wait for the server: completing a Dart Future from the SDK's Future is the next piece of the ABI, and is deliberately not faked here.

Implementation

void setString(String path, String value) {
  final p = path.toNativeUtf8();
  final v = value.toNativeUtf8();
  try {
    final rc = fdbDbSetString(p.cast(), v.cast());
    if (rc != 0) {
      throw StateError('set failed: $rc');
    }
  } finally {
    calloc.free(p);
    calloc.free(v);
  }
}