Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
merged 2 commits into from
Sep 12, 2022
Merged

Fix Magnifier crash #111303

merged 2 commits into from
Sep 12, 2022

Conversation

justinmc
Copy link
Contributor

@justinmc justinmc commented Sep 9, 2022

Fixes a crash that was happening when the magnifier was shown and no handles were visible.

Fixes #111301

@justinmc justinmc added a: text input Entering text in a text field or keyboard related problems c: crash Stack traces logged to the console labels Sep 9, 2022
@justinmc justinmc self-assigned this Sep 9, 2022
@flutter-dashboard flutter-dashboard bot added the framework flutter/packages/flutter repository. See also f: labels. label Sep 9, 2022
@@ -861,7 +861,7 @@ class SelectionOverlay {
context: context,
below: magnifierConfiguration.shouldDisplayHandlesInMagnifier
? null
: _handles!.first,
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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 {
Copy link
Contributor

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?

Copy link
Contributor

@Renzo-Olivares Renzo-Olivares left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@justinmc justinmc added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 12, 2022
@auto-submit auto-submit bot merged commit 8f9a519 into flutter:master Sep 12, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 13, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Sep 13, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Sep 13, 2022
@justinmc justinmc deleted the magnifier-no-handles branch September 13, 2022 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: text input Entering text in a text field or keyboard related problems autosubmit Merge PR when tree becomes green via auto submit App c: crash Stack traces logged to the console framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash: "_CastError at SelectionOverlay.showMagnifier"
2 participants