post_frame 2.0.0
post_frame: ^2.0.0 copied to clipboard
A Flutter package that provides utilities for executing actions after the current frame has been rendered, with support for waiting on scroll controllers and layout metrics.
2.0.0 #
- package no longer holds the source code for it, but exports/exposes the
s_packagespackage instead, which will hold this package's latest source code. - The only future changes to this package will be made via
s_packagespackage dependency upgrades, in order to bring the new fixes or changes to this package - dependent on
s_packages: ^1.1.2
1.1.0 #
Major release with comprehensive new features:
Core API Enhancements:
PostFrame.run<T>()- Advanced API with cancellation, timeout, diagnostics & generic return valuesPostFrame.builder()andPostFrame.simpleBuilder()- Declarative widget builders- Original
PostFrame.postFrame()retained (non-breaking) PostFrameResult<T>- Rich diagnostics (frames waited, passes, metric waits, controllers)
Iteration & Timing:
PostFrame.repeat()- Per-frame iteration with optional max iterations, interval & cancellationPostFrameRepeatercontroller with iteration streams and done future
Layout & Size Detection:
PostFrame.onLayout()- Await stable widget size using GlobalKey- Configurable stability frames and timeout handling
Task Management:
PostFrame.queueRun()- Serialized advanced post-frame tasksPostFrame.clearQueue()- Cancel pending queued tasksPostFrame.debounced()- Debounce rapid calls, cancel previous pending tasks
Conditional Execution:
predicateparameter onrun(),debounced(), andqueueRun()PostFramePredicateshelper class:mounted(),stateMounted(),routeActive(),scrollControllerHasClients(),scrollExtentAtLeast(),all(),any(),not()
BuildContext Extensions:
context.postFrame()- Simple post-frame with automatic mounted checkcontext.postFrameRun<T>()- Advanced with cancellation, timeout & mounted predicatecontext.postFrameDebounced<T>()- Debounced execution with mounted checkcontext.awaitLayout()- Convenience wrapper for layout waiting
Error Handling & Debugging:
- Global
PostFrame.errorHandlerfor all operations - Per-call
onErrorcallback parameter - Enhanced error propagation and diagnostics
Testing & Documentation:
- Comprehensive test suite (25 tests covering all features)
- Complete example app demonstrating all features
- README updated with usage examples for every feature
- Scroll metric stabilization improvements & clamp fix when
maxWaitFrames == 0
1.0.2 #
- updated
README.mdfile.
1.0.1 #
- Enhanced example folder with dynamic button interaction.
- Added a new test to verify
PostFrame.postFramewaits forScrollControllermetrics. - Updated dependencies in
pubspec.yaml.
1.0.0 #
- Initial public release.
- Provides
PostFrame.postFrameutility to execute actions after the first frame is rendered. - Supports waiting for end-of-frame and scroll controller metrics.
- Includes example and test files.
0.0.1 #
- Initial release