indexd_stack_dev 0.1.3
indexd_stack_dev: ^0.1.3 copied to clipboard
A high-performance lazy-loading IndexedStack for Flutter that initializes pages only when needed.
0.1.3 #
⚡ Performance & Fixes #
- Strict Widget Tree Stabilization: Fixed the critical bug where tabs would rebuild on every switch. The
AnimatedBuilderwrapper depth is now perfectly stable across allIndexdAnimationTypetransitions, ensuring Flutter never unmounts the page element. - Zero Per-Frame Allocations: Eliminated all dynamic
Animationobject creation within thebuild()method. AllReverseAnimationand derived animation objects are now tightly pre-cached once per transition, guaranteeingScaleTransitionandFadeTransitionnever invokedidUpdateWidgetrebuilds during layout. - Const Inert Animations: Optimized non-participating loaded tabs to use
static const kInertScale = AlwaysStoppedAnimation(1.0)and similar static wrappers. This allocates 0 bytes of memory per frame for background tabs while perfectly maintaining widget tree depth.
0.1.1 #
🐛 Fixes #
- Fixed page rebuild bug: Pages no longer rebuild continuously when animations are enabled.
AnimatedBuilderis now only attached during the active 300ms transition and stripped immediately after. - Eliminated unnecessary setState: Cache/loaded changes now use a targeted
Setequality check instead of blindly callingsetState(() {}).
0.1.0 #
⚡ Performance (Breaking) #
- Custom RenderObject: Replaced Flutter's native
IndexedStackwith a custom_RenderLazyStackthat skips layout computation entirely for inactive children. Only the active child participates in layout/paint. - Cached Animations: All
CurvedAnimationandTweenobjects are now created once per transition and cached as state fields — zero per-frame allocations. - Optimized
loadedIndexes: ReturnsSet<int>.unmodifiable()instead of allocating a newSeton every access. - Eliminated double eviction:
switchTono longer calls_enforceMaxSizetwice. - Removed
dart:mathdependency: Inlined max comparisons.
✨ Features #
- Native Tab Animations: Added
IndexdAnimationTypeenum with 5 transition styles:none(zero-overhead, no AnimationController allocated)fadefadeThrough(Material Design spec)sharedAxisHorizontalsharedAxisVertical
- Dynamic Animation Toggling: Switching between
noneand animated types at runtime is fully supported with proper resource lifecycle management. - Nullable AnimationController: When
animation: IndexdAnimationType.none, noAnimationControlleris created — true zero allocation.
🔧 Breaking Changes #
- Removed
EQprefix:EQLazyStackController→LazyStackController,EQLazyLoadIndexedStack→LazyLoadIndexedStack. - Removed
removableIndexes: Dead field that was never used internally. - Changed base class:
LazyLoadIndexedStackis now aStatefulWidget(wasListenableBuilder). - Removed
StackFit sizingparameter: The custom RenderObject handles sizing internally.
🐛 Fixes #
- Controller now uses
ChangeNotifierinstead of manual listener management. switchToperforms synchronous eviction beforenotifyListeners()— no double-frame builds.- Memory pressure handler (
didHaveMemoryPressure) aggressively flushes all inactive pages.