indexd_stack_dev 0.1.7
indexd_stack_dev: ^0.1.7 copied to clipboard
A high-performance lazy-loading IndexedStack for Flutter that initializes pages only when needed.
0.1.7 #
🐛 Fixes #
- Layout-contract crash with cached pages:
_RenderLazyStack.performLayoutnow lays out every attached child each pass, not just the active and outgoing ones. Cached (loaded but inactive) pages are real, mounted subtrees; skipping their layout left them inNEEDS-LAYOUT, so a cached page containing aTextField(or anything whose size is later read by the hostScaffold) would throwRenderBox was not laid out: RenderEditable... NEEDS-LAYOUT. Only the active child — and the outgoing child during a transition — still drive the stack's size; painting and hit-testing remain restricted to those, so inactive pages stay invisible. - Semantics: Added
visitChildrenForSemanticsso only the active page is exposed to the accessibility tree, matching stockIndexedStackbehavior now that inactive pages are laid out.
0.1.5 #
✨ Updates & Polish #
- Faster Animations: Decreased default animation duration from 250ms to 200ms for a snappier feel.
- Improved Animation Curves: Changed the shared axis slide animation curve to
fastOutSlowInand adjusted the slide offset from 15% to 7%.
0.1.4 #
✨ Updates & Cleanups #
- Premium Animation Curves: Upgraded the
Fade ThroughandShared Axistransition curves tofastLinearToSlowEaseInfor a much smoother, iOS/Material 3 style spring-damped feel. - Optimized Transition Offsets: Reduced the slide offset scale in Shared Axis transitions from 15% to 8% to create a more premium, subtle depth effect.
- Smoother Cross-fades: Fine-tuned opacity intervals for cross-fading, completely eliminating brief frame flashes during dark mode transitions.
- Codebase Polish: Cleaned up all artificial comments and explanatory text for a pristine, production-ready source code.
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.