chore: Add hint to init vodozemac also in native implementations

This commit is contained in:
Christian Kußowski 2025-06-16 08:50:19 +02:00
parent e8140edb7a
commit 71b878fd8c
No known key found for this signature in database
GPG Key ID: E067ECD60F1A0652
2 changed files with 29 additions and 3 deletions

View File

@ -49,13 +49,22 @@ For Flutter you can use [flutter_vodozemac](https://pub.dev/packages/flutter_vod
just needs to be initialized **once**: just needs to be initialized **once**:
```dart ```dart
import 'package:flutter_vodozemac/flutter_vodozemac' as vod; import 'package:flutter_vodozemac/flutter_vodozemac.dart' as vod;
// ... // ...
await vod.init(); await vod.init();
final client = Client(/*...*/); final client = Client('Matrix Client',
// ...
// ...
nativeImplementations: NativeImplementationsIsolate(
compute,
// Also init in NativeImplemenetations if you use it there:
vodozemacInit: () => vod.init(),
),
// ...
);
``` ```
This should work on Android, iOS, macOS, Linux and Windows. This should work on Android, iOS, macOS, Linux and Windows.

View File

@ -26,4 +26,21 @@ final client = Client(/*...*/);
This should work on Android, iOS, macOS, Linux and Windows. This should work on Android, iOS, macOS, Linux and Windows.
For web you need to compile vodozemac to wasm. [Please refer to the Vodozemac bindings documentation](https://pub.dev/packages/vodozemac#build-for-web). For web you need to compile vodozemac to wasm. [Please refer to the Vodozemac bindings documentation](https://pub.dev/packages/vodozemac#build-for-web).
### Using Vodozemac with NativeImplementations
When using NativeImplementations you have to initialize Vodozemac there as well.
Just pass the same init function to it:
```dart
final client = Client('Matrix Client',
// ...
// ...
nativeImplementations: NativeImplementationsIsolate(
compute,
vodozemacInit: () => vod.init(),
),
// ...
);
```