lazy_indexed_stack_plus 0.0.1
lazy_indexed_stack_plus: ^0.0.1 copied to clipboard
The ultimate enhanced IndexedStack with lazy loading, preloading, and state preservation made easy for optimized Flutter apps.
The ultimate enhanced IndexedStack with lazy loading, preloading, and state preservation made easy for optimized Flutter apps.
Features #
- π Lazy Loading: Children are only built when they first become active.
- β‘ Preloading: Specify indexes to load in the background before the user navigates to them.
- πΎ State Preservation: Keeps the state of children alive (scroll position, text inputs, etc.) once loaded.
- π οΈ Custom Placeholders: Show a custom widget (like a loader) for uninitialized tabs.
- π Placeholder Sync: Automatically updates placeholders across all tabs if the placeholder widget changes.
Getting started #
Add the dependency to your pubspec.yaml:
dependencies:
lazy_indexed_stack_plus: ^0.0.1
Usage #
LazyIndexedStackPlus(
index: 0,
preloadIndexes: {1}, // Optional: Preload specific tabs
placeholder: Center(child: CircularProgressIndicator()),
children: [
HomeTab(),
ProfileTab(),
SettingsTab(),
],
);