JsPlugin class final

Explicit plugin package made from a manifest and a module graph.

Available extensions

Constructors

JsPlugin({required JsPluginManifest manifest, required List<JsPluginModule> modules})
Creates and validates an explicit plugin module graph.
JsPlugin.asset({required String id, required String version, required String path, required List<String> exports, String? init, String? dispose, AssetBundle? bundle, List<String> permissions = const <String>[], Map<String, Object?> metadata = const <String, Object?>{}, String entryName = 'main'})
Creates a single-module plugin from one Flutter asset path.
factory
JsPlugin.assets({required JsPluginManifest manifest, required Map<String, String> modules, AssetBundle? bundle})
Creates a multi-module plugin from module-name to asset-path mappings.
factory
JsPlugin.source({required String id, required String version, required String source, required List<String> exports, String? init, String? dispose, List<String> permissions = const <String>[], Map<String, Object?> metadata = const <String, Object?>{}, String entryName = 'main'})
Creates a single-module plugin from inline JavaScript source.
factory
JsPlugin.sources({required JsPluginManifest manifest, required Map<String, String> modules})
Creates a multi-module plugin from inline JavaScript sources.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
manifest JsPluginManifest
Validated plugin contract and lifecycle declaration.
final
modules List<JsPluginModule>
Immutable module graph owned by this plugin.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

asFeatures({String? name}) JsFeatures

Available on JsPlugin, provided by the JsPluginInternalFeatures extension

将插件转换为运行时组合层使用的 JsFeatures
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

Static Methods

fromManifest({required String source, required Map<String, String> modules}) JsPlugin
Parses a manifest JSON string and inline module sources as one plugin.
manifestAsset({required String path, required Map<String, String> modules, AssetBundle? bundle}) Future<JsPlugin>
Loads a manifest JSON asset and its module asset map as one plugin.