dart:js
JsObject class
A proxy on a JavaScript object.
The properties of the JavaScript object are accessible via the [] and []= operators. Methods are callable via callMethod.
- Implementers
Constructors
- JsObject(JsFunction constructor, [List? arguments])
factory
- Constructs a JavaScript object from its native
constructor and returns a proxy to it. - JsObject.fromBrowserObject(Object object)
factory
- Constructs a JsObject that proxies a native Dart object; for expert use only.
- JsObject.jsify(Object object)
factory
- Recursively converts a JSON-like collection of Dart objects to a collection of JavaScript objects and returns a JsObject proxy to it.
Properties
- hashCode → int
read-only, override
- The hash code for this object.
- runtimeType → Type
read-only, inherited
- A representation of the runtime type of the object.
Methods
- callMethod(Object method, [List? args]) → dynamic
- Calls
method on the JavaScript object with the arguments args and returns the result. - deleteProperty(Object property) → void
- Removes
property from the JavaScript object. - hasProperty(Object property) → bool
- Returns
true if the JavaScript object contains the specified property either directly or though its prototype chain. - instanceof(JsFunction type) → bool
- Returns
true if the JavaScript object has type in its prototype chain. - noSuchMethod(Invocation invocation) → dynamic
inherited
- Invoked when a non-existent method or property is accessed.
- toString() → String
override
- Returns the result of the JavaScript objects
toString method.
Operators
- operator ==(Object other) → bool
override
- The equality operator.
- operator [](Object property) → dynamic
- Returns the value associated with
property from the proxied JavaScript object. - operator []=(Object property, Object? value) → void