Appearance
ObjectToExternalDartReference<T extends Object?>
extension ObjectToExternalDartReference<T extends Object?> on TConversions from a value of type T to ExternalDartReference.
Properties
toExternalReference extension no setter
ExternalDartReference<T> get toExternalReferenceAn opaque reference to this value of type T which can be passed to JavaScript.
When compiling to JavaScript, a Dart object is a JavaScript object, and therefore this directly returns the Dart object. When compiling to Wasm, an internal Wasm function is used to convert the Dart object to an opaque JavaScript value. If this value is null, returns null.
A value of type ExternalDartReference should be treated as completely opaque. It can only be passed around as-is or converted back using ExternalDartReferenceToObject.toDartObject.
When this getter is called multiple times on the same Dart object, the underlying references in the resulting ExternalDartReferences are guaranteed to be equal. Therefore, == will always return true between such ExternalDartReferences. However, like JS types, identical between such values may return different results depending on the compiler.
Available on T extends Object?, provided by the ObjectToExternalDartReference<T extends Object?> extension
Implementation
dart
external ExternalDartReference<T> get toExternalReference;