NSString.fromPointer constructor

NSString.fromPointer(
  1. Pointer<Void> ptr
)

Implementation

NSString.fromPointer(Pointer<Void> ptr) : super.fromPointer(ptr) {
  Pointer<Uint64> length = calloc<Uint64>();
  Pointer<Void> result = convertNSStringToUTF16(ptr, length);
  Uint16List list = result.cast<Uint16>().asTypedList(length.value);
  calloc.free(length);
  raw = String.fromCharCodes(list);
}