Movatterモバイル変換


[0]ホーム

URL:


menu
  1. Dart
  2. dart:js_interop
  3. JS class
JS
description

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

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(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
  1. Dart
  2. dart:js_interop
  3. JS class
dart:js_interop library

[8]ページ先頭

©2009-2025 Movatter.jp