iceblock_flutter (0.16.0)
Installation
dart pub add iceblock_flutter:0.16.0 --hosted-url=https://git.tricauda.com/api/packages/iceblock/pub/About this package
iceblock_flutter
Iceblock for Flutter apps (#658): the SDK's facade, iceblock-sdk, for
Dart, with Iceblock's library compiled inside for Android (64-bit ARM, and
x86_64 for the emulator) and Linux (x86_64, glibc 2.34 or later). An app
keeps its own Collections, shares them, and joins the user's Iceblock, with
no Rust of its own. The SDK's pages are at https://iceblock.tricauda.com/sdk/.
dependencies:
iceblock_flutter:
hosted: https://git.tricauda.com/api/packages/iceblock/pub
version: ^0.14.4
await Iceblock.init();
final app = await IceblockApp.start(config: IceblockConfig(
dataDir: '${(await getApplicationSupportDirectory()).path}/iceblock',
appId: 'com.example.notes',
appName: 'Notes',
asks: const ['collections'],
requires: const [],
));
final own = await app.ownCollection();
await app.write(collection: own.id, path: 'plan.md', bytes: utf8.encode(text));
app.watch(collection: own.id).listen((changes) => refresh());
app.events().listen((e) { /* granted, denied, removed, join-asked */ });
example/ is a small notes app on it.
The platform parts (Android's network and power conditions, work in the
background, waking, joining Iceblock on the same phone) are in
iceblock_platform, which an app on this package uses too: pass its
Conditions to setConditions.
Building it here
The library isn't committed: tool/build-libs.sh linux builds it for
flutter test and a Linux build, tool/build-libs.sh android (in the
repo's android.nix shell) for Android. Releases build both and publish
the package with them. After changing rust/src/api.rs, regenerate the
bindings with flutter_rust_bridge_codegen generate.