Merge pull request #2109 from famedly/krille/add-hint-to-init-vodozemac-in-native-implementations

chore: Add hint to init vodozemac also in native implementations
This commit is contained in:
Krille-chan 2025-06-16 09:04:38 +02:00 committed by GitHub
commit 2cdc977c1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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(),
),
// ...
);
```