JS class - dart:js_interop library (original) (raw)

An annotation on a JavaScript interop declaration.

This annotation defines a given library, top-level external declaration, or extension type as a JavaScript interop declaration.

Specifying name customizes the JavaScript name to use, which can be used in the following scenarios:

In the case where name is not specified, the Dart name of the extension type or external declaration is used as the default.

See https://dart.dev/interop/js-interop/usage#js for more details on how to use this annotation.

Note

package:js exports an @JS annotation as well. Unlike that annotation, this annotation applies to extension types, and will result in more type-checking for external top-level declarations.

Constructors

JS([String? name])

const

Properties

hashCodeint

The hash code for this object.

no setterinherited

nameString?

final

runtimeTypeType

A representation of the runtime type of the object.

no setterinherited

Methods

noSuchMethod(Invocation invocation)→ dynamic

Invoked when a nonexistent method or property is accessed.

inherited

toString()→ String

A string representation of this object.

inherited

Operators

operator ==(Object other)→ bool

The equality operator.

inherited