Iceblock
New Zealand

iceblock_platform (0.16.1)

Published 2026-10-23 09:04:13 +13:00 by snowball-releases

Installation

dart pub add iceblock_platform:0.16.1 --hosted-url=https://git.tricauda.com/api/packages/iceblock/pub/

About this package

What an app built on Iceblock needs from the platform, without Iceblock's library: Android's network and power conditions, work in the background, waking and being woken by Iceblock and other apps built on it, and finding Iceblock. Linux: finding and waking Iceblock.

iceblock_platform

What an app built on Iceblock needs from the platform, without Iceblock's library (#657). The Iceblock app uses it too. The SDK's pages are at https://iceblock.tricauda.com/sdk/.

  • Conditions (Android): what the library can't see for itself, from IceblockPlatform.conditions() and IceblockPlatform.conditionChanges. That's whether the phone is on a VPN, metered, on mobile data or charging, its router's address, and whether the battery saver is on. Pass them to the library.
  • Work in the background (Android): Background.setUp('entryPoint') runs a Dart entry point of the app's, in an engine of its own without the app's window. It runs every 15 minutes or so on an unmetered network and hourly on any, when the battery isn't low, and soon after another app wakes this one. The entry point ends each go with Background.done(). Background.why() says whether it was scheduled or woken. It's on by default: Background.enabled(), Background.setEnabled(), and Background.limits() for how far Android holds it back.
  • Waking (Android): IceblockPlatform.wakeIceblock() wakes Iceblock on the same phone, to take what's new and send it on; IceblockPlatform.wake(package) wakes another app built on Iceblock. A woken app runs a go of its background work, at most one a minute. Anyone may wake an app: it only asks for a sync.
  • Finding Iceblock: IceblockPlatform.iceblockInstalled(). On Linux it looks for the iceblock command, and wakeIceblock() runs iceblock sync.

The entry point

@pragma('vm:entry-point')
Future<void> backgroundWork() async {
  WidgetsFlutterBinding.ensureInitialized();
  try {
    // Start the library, pass it IceblockPlatform.conditions(), sync,
    // post notifications for what came.
  } finally {
    await Background.done();
  }
}

The go runs with the app's plugins. For channels of the app's own, it names a class implementing com.tricauda.iceblock.platform.BackgroundSetup in its manifest's <application>:

<meta-data
    android:name="com.tricauda.iceblock.platform.BACKGROUND_SETUP"
    android:value="com.example.app.MyBackgroundSetup"/>

Manifest

The package declares what it needs: the network state, the receiver for being woken, and Iceblock's package among <queries>. To wake another app built on Iceblock, the app adds that app's package to its own <queries>.

Details
Pub
2026-10-23 09:04:13 +13:00
0
18 KiB
Assets (1)
0.16.1.tar.gz 18 KiB
Versions (36) View all
0.16.11 2026-10-25
0.16.10 2026-10-25
0.16.9 2026-10-24
0.16.8 2026-10-24
0.16.7 2026-10-24