ThermionViewerWasm constructor

ThermionViewerWasm({
  1. JSObject? module,
  2. String moduleName = "thermion_dart",
  3. String? assetPathPrefix,
})

Construct an instance of this class by explicitly passing the module instance via the module property, or by specifying moduleName, being the name of the window property where the module has already been loaded.

Pass assetPathPrefix if you need to prepend a path to all asset paths (e.g. on Flutter where the asset directory /foo is actually shipped under the directory /assets/foo, you would construct this as:

final viewer = ThermionViewerWasm(assetPathPrefix:"/assets/")

Implementation

ThermionViewerWasm(
    {JSObject? module,
    String moduleName = "thermion_dart",
    String? assetPathPrefix}) {
  _module = module as _EmscriptenModule? ??
      window.getProperty<_EmscriptenModule>(moduleName.toJS);
  if (assetPathPrefix != null) {
    _setAssetPathPrefix(assetPathPrefix);
  }
}