colibri_flutter 0.1.2
colibri_flutter: ^0.1.2 copied to clipboard
Flutter plugin for Colibri Stateless with bundled native binaries (Android arm64/armeabi/x86_64, iOS). Proof generation and verification for Ethereum RPC.
Colibri Flutter #
Flutter plugin for Colibri Stateless with bundled native binaries (Android + iOS). No manual build or libraryPath needed.
Install (pub.dev) #
dependencies:
colibri_flutter: ^0.1.0
Then:
flutter pub get
Usage #
import 'package:colibri_flutter/colibri_flutter.dart';
final colibri = Colibri(chainId: 1);
final block = await colibri.rpc('eth_blockNumber', []);
colibri.close();
On Android and iOS the native library is loaded automatically (no libraryPath).
Local / path dependency #
For development against a local colibri_stateless:
dependencies:
colibri_flutter:
path: /path/to/colibri-stateless/bindings/dart/flutter/colibri_flutter
colibri_stateless:
path: /path/to/colibri-stateless/bindings/dart
Building native binaries (for maintainers) #
To refresh the binaries shipped in this package:
# from repo root
./scripts/build_flutter_binaries.sh
This updates:
android/src/main/jniLibs/<abi>/libcolibri.soios/Frameworks/c4_swift.xcframework
Publishing (pub.dev) #
- Publish colibri_stateless first from
bindings/dart. - Repository verification: pub.dev expects the repository URL to clone to a repo that contains a
pubspec.yamlwithname: colibri_flutterat root. This package lives in a monorepo subdirectory, so to pass that check either:- Option A: Create a mirror repo (e.g.
corpus-core/colibri-flutter) with this directory’s contents at root. Push the mirror, setrepository: https://github.com/corpus-core/colibri-flutterin pubspec.yaml, then publish. - Option B: Run
./scripts/prepare_pub_mirror.shfrom this directory to copy the package into a sibling folder; push that folder as the mirror repo, then setrepositoryin pubspec to the mirror URL and publish.
- Option A: Create a mirror repo (e.g.
- From this directory:
dart pub publish --dry-run, thendart pub publish.
iOS note #
iOS does not allow dynamic dlopen of external libraries. The XCFramework is linked into the app; the Dart FFI loader uses DynamicLibrary.process().