setUtf8String method

void setUtf8String(
  1. String value
)

General Library Documentation Undocument By General Corporation & Global Corporation & General Developer

Implementation

void setUtf8String(String value) {
  final mem = Memory();
  final pStr = value.toNativeUtf8(allocator: mem.allocator).cast<Char>();
  for (var i = 0;; i++) {
    this[i] = pStr[i];
    if (pStr[i] == 0) {
      break;
    }
  }
  mem.allocator.free(pStr);
}