fix(canvas): keep the drawing open when the screen rotates - #1317
Open
joepio wants to merge 2 commits into
Open
Conversation
Android was treating a rotation as a back press (PopScope fires when window metrics change), which dumped the user back on the gallery. Ignore pops in that window, remember the open canvas across an activity recreate, and allow landscape in the web manifest. Co-authored-by: joepmeindertsma <joepmeindertsma@gmail.com>
…d test _openFromGallery is async; restore after rotation has to wait for strokes to load. The session test file had been written twice. Co-authored-by: joepmeindertsma <joepmeindertsma@gmail.com>
joepio
marked this pull request as ready for review
August 31, 2026 16:16
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.
Rotating a tablet (or phone) while drawing dumped Atomic Canvas back on the gallery.
Android re-registers the predictive-back callback when window metrics change, and
PopScope(canPop: false)treated that as a real back press. The canvas also was not a route, so an activity recreate (some OEMs still do this on rotation) lost_openCanvasand showed the gallery.CanvasPopScope+RotationPopGuard).AtomicSessionand restore it after login / store load.colorModeto AndroidconfigChanges.Tests cover the guard, the PopScope widget (rotation vs a later back press), and session persist / clear.
flutter analyze lib testis clean;flutter testis green (70 tests).