Fix boot overlay '!_dirty' assertion in debug mode with zero fade duration#6666
Merged
Conversation
…ation With the default boot_screen.fade_out_duration of 0, _BootOverlay's AnimatedOpacity completed synchronously when boot status turned done, firing onEnd (and its setState) in the middle of the overlay's own rebuild and tripping the framework's assert(!_dirty) in debug mode. Remove the overlay in a single state update when no fade is configured; non-zero fade durations still take the animated path.
Deploying flet-website-v2 with
|
| Latest commit: |
8fd424d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://04600076.flet-website-v2.pages.dev |
| Branch Preview URL: | https://fix-boot-overlay-dirty-asser.flet-website-v2.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Running an app built from the
flet buildtemplate in debug mode (e.g.flet debug android) throws when the app becomes ready:Cause
With the default
boot_screen.fade_out_durationof 0,_BootOverlay'sAnimatedOpacitygets aDuration.zeroanimation when boot status turnsdone. The underlyingAnimationControllercompletes synchronously, firingonEnd— and itssetState(() => _removed = true)— in the middle of the overlay's own rebuild, tripping the framework'sassert(!_dirty).Debug-mode only: the assertion is compiled out of release builds, so packaged apps were unaffected.
Fix
When no fade is configured,
_onStatusnow removes the overlay in a single state update (_fadingOut+_removedtogether) instead of going through the zero-duration animation. Non-zero fade durations still take the animatedonEndpath as before.Verified on an Android emulator with
flet debug android— the assertion no longer fires and the boot overlay is dismissed as expected.Summary by Sourcery
Resolve a debug-only boot overlay assertion triggered in apps built from the flet build template when the app becomes ready.
Bug Fixes:
Documentation: