-
Notifications
You must be signed in to change notification settings - Fork 28.7k
Fix Magnifier crash #111303
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
Fix Magnifier crash #111303
Conversation
@@ -861,7 +861,7 @@ class SelectionOverlay { | |||
context: context, | |||
below: magnifierConfiguration.shouldDisplayHandlesInMagnifier | |||
? null | |||
: _handles!.first, |
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.
Should the || _handles == null
above on line 856 be removed?
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.
Yes thank you! I think you added that check just before I created this PR and I somehow totally missed it. Likely your PR has already fixed the crash that I was trying to fix with this PR. I think this PR is still worthwhile to allow the magnifier to show without the handles being visible though. Let me know what you think of the code now after my change.
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.
Yeah I added that check, and I agree this is still a worthwhile change.
@@ -1279,6 +1281,28 @@ void main() { | |||
await tester.pump(const Duration(milliseconds: 20)); | |||
expect(endDragEndDetails, isNotNull); | |||
}); | |||
|
|||
testWidgets('can show magnifier when no handles exist', (WidgetTester tester) async { |
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.
Should we also, at the end of this test, confirm the magnifier is showing?
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
Fixes a crash that was happening when the magnifier was shown and no handles were visible.
Fixes #111301