Skip to content
pubscout

lifecycle

1.0.0, released 3 months ago by an unverified publisher

Composable app, route, page, and viewport lifecycle for Flutter widgets.

WASM-ready
$ flutter pub add lifecycle
Source repository

What it does

Combines app state, Navigator routes, paged containers, and scroll viewports into an immutable lifecycle snapshot. Emits deterministic transition events for descendants without global observers or event buses.

AI-written summary of version 1.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need fine-grained lifecycle awareness inside complex scroll views, tab views, or page views.
  • You want to react to specific widget visibility, activation, and route transitions.

Skip it when

  • Your application is extremely simple and does not require custom visibility or lifecycle triggers beyond standard widget tree methods.

Strengths

  • Provides deterministic phase events in a tree hierarchy.
  • Supports nested navigators, PageView, TabBarView, and scrollable viewports out of the box.

Weaknesses

  • Requires explicit controller and scope setup for app and navigators.
  • Version 1.0 introduces a breaking API redesign from previous 0.x versions.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0

Requires wrapping your app with LifecycleApp and adding NavigatorLifecycleController for navigators.

LifecycleListener(
  onTransition: (transition) {
    debugPrint('${transition.previous.phase} → ${transition.current.phase}');
  },
  child: const Content(),
)

Alternatives

Packages that do the same job and could replace lifecycle.