Renzo Olivares d620ec9274
fix: SelectableRegion should only finalize selection after changing (#159698)
There are some cases where selection behavior varies on a given platform
by the pointer device, for example dragging to select changes on mobile
platforms depending on whether a mouse or a touch is used. When a mouse
is used a user can drag to select normally, when a touch is used the
selection does not change on mobile platforms when dragging.

Before this change at the end of a touch drag users would still be
notified the selection was finalized even though nothing changed and
they had not previously received a `changing` notification. After this
change the selection is no longer finalized unless the
`SelectableRegionSelectionStatus` was previously in a `changing` state.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

---------

Co-authored-by: Renzo Olivares <roliv@google.com>
2024-12-10 01:25:58 +00:00
..