mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
![]() Fixes https://github.com/flutter/flutter/issues/131435, #104594, #43400 Needs https://github.com/flutter/engine/pull/48774 (to fix the web test failure). Currently the method we use for text span hit testing `TextPainter.getPositionForOffset` always returns the closest `TextPosition`, even when the given offset is far away from the text. The new TextPaintes method tells you the layout bounds (`width = letterspacing / 2 + x_advance + letterspacing / 2`, `height = font ascent + font descent`) of a character, the PR changes the hit testing implementation such that a TextSpan is only considered hit if the point-down event landed in one of it's character's layout bounds. Potential issues: 1. In theory since the text is baseline aligned, we should use the max ascent and max descent of each character to calculate the height of the text span's hit-test region, in case some characters in the span have to fall back to a different font, but that will be slower and it typically doesn't make a huge difference. This is a breaking change. It also introduces a new finder and a new method `WidgetTester.tapOnText`: `await tester.tapOnText('string to match')` for ease of migration. |
||
---|---|---|
.. | ||
bindings_environment | ||
custom_exception_reporter | ||
semantics_checker | ||
test_config | ||
utils | ||
accessibility_test.dart | ||
accessibility_window_test.dart | ||
all_elements_test.dart | ||
analysis_options.yaml | ||
bindings_async_gap_test.dart | ||
bindings_reset_test.dart | ||
bindings_restoration_test.dart | ||
bindings_test_failure.dart | ||
bindings_test.dart | ||
controller_test.dart | ||
coordinate_translation_test.dart | ||
demangle_test.dart | ||
display_test.dart | ||
event_simulation_test.dart | ||
finders_test.dart | ||
frame_timing_summarizer_test.dart | ||
goldens_test.dart | ||
integration_bindings_test.dart | ||
live_binding_test.dart | ||
live_widget_controller_test.dart | ||
matchers_test.dart | ||
mock_canvas_test.dart | ||
multi_view_accessibility_test.dart | ||
multi_view_controller_test.dart | ||
multi_view_testing.dart | ||
platform_dispatcher_test.dart | ||
reference_image_test.dart | ||
restoration_test.dart | ||
stack_manipulation_test.dart | ||
test_async_utils_test.dart | ||
test_default_binary_messenger_test.dart | ||
test_text_input_test.dart | ||
view_test.dart | ||
widget_tester_live_device_test.dart | ||
widget_tester_test.dart | ||
window_test.dart |