New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bring back paste button hide behavior 2 #56922
Conversation
flutter#56806)" This reverts commit 0786f29.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -1524,7 +1524,7 @@ class ClipboardStatusNotifier extends ValueNotifier<ClipboardStatus> with Widget | |||
final ClipboardStatus clipboardStatus = data != null && data.text != null && data.text.isNotEmpty | |||
? ClipboardStatus.pasteable | |||
: ClipboardStatus.notPasteable; | |||
if (clipboardStatus == value) { | |||
if (clipboardStatus == value || _disposed) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move the if (_disposed) check to be the first thing in this callback since we don't have to do any of the other work if that happens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Smart, will do.
8f79c5e
to
0a2c0a5
Compare
I believe this causes a new failure:
|
…" (flutter#56951)" This reverts commit c969b8a.
Original PR that has been reverted twice now: #54902
This caused a failure where the ClipboardStatusNotifier was modified after being disposed, which seems to be caused by receiving the clipboard data after disposal. My one line fix for this is to check if it's disposed before updating the value.