JS class
An annotation on a JavaScript interop declaration.
This annotation defines a given library, top-level external declaration, orextension type as a JavaScript interop declaration.
Specifyingname customizes the JavaScript name to use, which can be usedin the following scenarios:
- Adding a JavaScript prefix to all the external top-level declarations,static members, and constructors of a library by parameterizing theannotation on the library withname.
- Specifying the JavaScript class to use for external static members andconstructors of an interop extension type by parameterizing the annotationon the interop extension type withname.
- Renaming external declarations by parameterizing the annotation on themember withname.
In the case wherename is not specified, the Dart name of the extensiontype or external declaration is used as the default.
Seehttps://dart.dev/interop/js-interop/usage#js for more details on how touse this annotation.
Note
package:js exports an@JS annotation as well. Unlike that annotation,this annotation applies to extension types, and will result in moretype-checking for external top-level declarations.
Constructors
Properties
Methods
- noSuchMethod(
Invocationinvocation)→ dynamic - Invoked when a nonexistent method or property is accessed.inherited
- toString(
)→String - A string representation of this object.inherited
Operators
- operator ==(
Objectother)→bool - The equality operator.inherited