after_first_frame_mixin 1.0.0
after_first_frame_mixin: ^1.0.0 copied to clipboard
Run code after the first layout of a widget has been performed, i.e. after the first frame has been displayed - as a mixin or as a widget.
1.0.0 #
Added #
AfterFirstFramewidget - the widget form of the mixin, for subtrees that would otherwise have no reason to be stateful.afterNextFrame(callback)on the mixin - the counterpart ofafterFirstFramefor later frames, callable at any point in the widget's life, e.g. to measure a layout asetStatehas just changed.hasRenderedFirstFrame- whether the first frame has been displayed.AfterFrameCallbacktypedef for the callback signature.
Fixed #
- Errors thrown by an asynchronous
afterFirstFrameare reported throughFlutterError.reportError. The returnedFutureused to be dropped, so its error escaped as an unhandled asynchronous error, without widget diagnostics and out of reach ofFlutterError.onErrorandtester.takeException().
Other #
- Requires Dart 3.8 / Flutter 3.32;
flutter_lints6. - First test suite: 13 tests covering both APIs, the mounted guard and error reporting. The package previously shipped an empty test.
- IDE files (
.idea/,*.iml) are no longer committed nor published. - README rewritten: installation, both APIs, an API table and the scheduling caveats.
0.0.2 #
- Minor changes.
0.0.1 #
- Initial release.