Skip to content
pubscout

flutter_lazy_indexed_stack

0.1.0, released a year ago by marcossevilla.dev

An IndexedStack widget that loads children lazily only when needed.

WASM-ready
$ flutter pub add flutter_lazy_indexed_stack
Source repository

What it does

Exposes an IndexedStack alternative that lazily loads its children instead of rendering all of them at once. It uses the same API as IndexedStack requiring a list of children and an active index.

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

Use it when

  • You have a lot of children in an IndexedStack and want to avoid loading them all at once.
  • You have children that load content asynchronously and need to be deferred until selected.

Skip it when

  • You need standard IndexedStack behavior where all child states must remain active simultaneously from initial render.

Strengths

  • Improves performance by lazy-loading children in an IndexedStack.
  • Drop-in API compatibility with the standard IndexedStack widget.

Weaknesses

  • State of non-selected children might not be initialized until they are activated for the first time.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
LazyIndexedStack(
  index: index,
  children: List.generate(3, (i) => Text('$i')),
)

Alternatives

Packages that do the same job and could replace flutter_lazy_indexed_stack.