wrap<T extends Object> method
Returns the JavaScript wrapper for a Dart object of a registered class.
Reuses a live wrapper without running the Dart constructor. If the previous
wrapper was collected, creates another using the registered JS constructor.
A new wrapper requires exactly one defineClass registration for T.
Exported subclasses share their most specific registered wrapper.
A live wrapper for an unrelated registered class cannot be reused as T.
num, String, bool, records and FFI values receive independent wrappers.
Implementation
JsObject wrap<T extends Object>(T value) => _wrapClass(value, T);