live_activity_kit library
A universal, component-based framework for iOS Live Activities / Dynamic Island and Android Live Updates (ongoing notifications), driven from Dart.
Apple does not let Flutter render inside a Live Activity — the UI must be SwiftUI, in a widget extension. This package closes that gap by shipping a declarative component tree from Dart as JSON and drawing it with a bundled recursive SwiftUI renderer.
See the README for setup (dart run live_activity_kit:setup).
Classes
- LA
- The component DSL.
- LACircularProgress
- LAColumn
- LAContainer
- LACountdown
- A self-updating timer.
- LADivider
- LAImage
- LAInsets
- Insets used by LAPadding and LAContainer.
- LAMetric
-
A label/value pair — the workhorse of stat rows (
4.2 km,320 kcal). - LANode
- LAPadding
- LAProgress
- LARow
- LASpacer
- LAText
- LATheme
- Colors applied around the rendered trees.
- LiveActivity
- The public entry point.
- LiveActivityAlert
- An alert shown when an update arrives while the device is locked.
- LiveActivityEndPolicy
-
Controls the dismissal behaviour passed to
Activity.end(_:dismissalPolicy:). - LiveActivityHandle
- A handle to a running activity.
- LiveActivityLayout
- A complete Live Activity UI: one component tree per region.
- LiveActivityPlatform
- Platform boundary.
- LiveActivityPushToken
-
Emitted by
LiveActivity.pushTokenswhenever ActivityKit rotates a token. - LiveActivityStateChange
-
Emitted by
LiveActivity.stateson every lifecycle transition. - LiveActivityStore
- Shared storage between the Flutter app and the widget extension.
- LiveActivitySupport
- Whether this device can run Live Activities right now.
- MethodChannelLiveActivity
-
MethodChannel+EventChannelimplementation.
Enums
- LAAlign
- Cross-axis alignment for LARow / LAColumn.
- LACountdownStyle
- Rendering style for LACountdown.
- LADistribution
-
Main-axis distribution. SwiftUI stacks have no
MainAxisAlignment, so the renderer emulates these by insertingSpacer()s. - LAImageSource
- Where an image comes from.
- LARegion
- The presentation regions iOS offers a Live Activity.
- LiveActivityDismissal
-
How iOS should retire an activity after
end(). - LiveActivityState
- Lifecycle state reported by ActivityKit.
Exceptions / Errors
- LANodeDecodeException
- Thrown when a JSON payload cannot be turned back into a LANode.
- LiveActivityException
- Thrown for every failure surfaced by the native side.