Add a note in ImeSyncDeferringInsetsCallback explaining the reason behind capturing the latest final inset state (flutter/engine#43109)

Solely documentation change to explain the reasoning behind the change in https://github.com/flutter/engine/pull/42700.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
gmackall 2023-06-23 07:21:55 -07:00 committed by GitHub
parent 848795bbc4
commit 805cd4816d

View File

@ -68,6 +68,12 @@ class ImeSyncDeferringInsetsCallback {
// When an animation begins, android sends a WindowInset with the final
// state of the animation. When needsSave is true, we know to capture this
// initial WindowInset.
//
// Certain actions, like dismissing the keyboard, can trigger multiple
// animations that are slightly offset in start time. To capture the
// correct final insets in these situations we update needsSave to true
// in each onPrepare callback, so that we save the latest final state
// to apply in onEnd.
private boolean needsSave = false;
ImeSyncDeferringInsetsCallback(@NonNull View view) {