Ovok js bridge

Generated reference for ovok_flutter: ovok js bridge.

  • Stable unknown
  • Release candidate not available
  • Development since 0.2.0-dev.51+80996d9

OvokJsBridge

class OvokJsBridge implements JsContract

Runs @ovok/native/next in an embedded JavaScript engine.

The engine does the contract's work; HTTP and the session store stay in Dart and are reached through the host channel.

Constructors

OvokJsBridge.new

OvokJsBridge({
  required String baseUrl,
  required String tenantCode,
  required OvokSecureStore secureStore,
  String fhirPath = 'fhir',
  Client? httpClient,
  OvokJsBundleLoader? loadBundle,
})

Creates a bridge for tenantCode on the API at baseUrl.

secureStore must be the store the Dart Ovok client uses, so both sides share one session. httpClient replaces the default http.Client.

ParameterTypeKindDefault
baseUrlStringrequired named
tenantCodeStringrequired named
secureStoreOvokSecureStorerequired named
fhirPathStringnamed'fhir'
httpClientClient?named
loadBundleOvokJsBundleLoader?named

Properties

OvokJsBridge.baseUrl

final String baseUrl

Absolute URL of the Ovok API.

OvokJsBridge.tenantCode

final String tenantCode

Code of the tenant the client works in.

OvokJsBridge.secureStore

final OvokSecureStore secureStore

Where the session lives.

OvokJsBridge.fhirPath

final String fhirPath

Path of the FHIR API under baseUrl.

Methods

OvokJsBridge.evaluate

Future<Object?> evaluate(String name, List<Object?> args)

Runs ovokNative.<name>(...args) and returns its decoded JSON result.

Throws OvokJsException when the JavaScript call fails.

ParameterTypeKindDefault
nameStringpositional
argsList<Object?>positional

Returns Future<Object?>.

OvokJsBridge.dispose

void dispose()

Frees the engine.

Returns void.

OvokJsBundleLoader

typedef OvokJsBundleLoader = Future<String> Function()

Loads the bundle source; the default reads the asset shipped with this package.

Last updated on

On this page