initialize method
Future<void>
initialize(
)
override
Implementation
@override
Future<void> initialize() async {
if (_isInitialized) return;
try {
// Check if WASM client is available
if (wasmHttpClient == null) {
throw const FittorWasmException(
'WasmHttpClient not available in global scope');
}
final initPromise = _initializeWasm();
if (initPromise == null) {
throw const FittorWasmException(
'WasmHttpClient.initialize not available');
}
await initPromise.toDart;
_isInitialized = true;
} catch (e) {
throw FittorWasmException('Failed to initialize WASM: $e', e);
}
}