JSString.fromString constructor
JSString.fromString(
- String? string
Creates a JavaScript string from dart String.
string
The dart String.
Implementation
JSString.fromString(String? string) {
if (string == null) {
_pointer = nullptr;
} else {
var cString = string.toNativeUtf8();
_pointer = JSStringRef.jSStringCreateWithUTF8CString(cString);
malloc.free(cString);
}
}