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 JsContractRuns @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.
| Parameter | Type | Kind | Default |
|---|---|---|---|
baseUrl | String | required named | |
tenantCode | String | required named | |
secureStore | OvokSecureStore | required named | |
fhirPath | String | named | 'fhir' |
httpClient | Client? | named | |
loadBundle | OvokJsBundleLoader? | named |
Properties
OvokJsBridge.baseUrl
final String baseUrlAbsolute URL of the Ovok API.
OvokJsBridge.tenantCode
final String tenantCodeCode of the tenant the client works in.
OvokJsBridge.secureStore
final OvokSecureStore secureStoreWhere the session lives.
OvokJsBridge.fhirPath
final String fhirPathPath 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.
| Parameter | Type | Kind | Default |
|---|---|---|---|
name | String | positional | |
args | List<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