Skip to content
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

Detect when tap target is covered #61

Merged
merged 27 commits into from
Jun 27, 2024
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
3e45cc3
Add optimized search for interactable widget positions
danielmolnar Jun 21, 2024
ac9a157
Add test "Finds widgets after dragging down and up"
danielmolnar Jun 21, 2024
7f6dfb8
Add print warning
danielmolnar Jun 21, 2024
a79007f
Add CustomTappableArea
danielmolnar Jun 22, 2024
e4c8bb4
Add test "Partially covered, finds tappable area"
danielmolnar Jun 22, 2024
6a00a46
Add MeasureSize PokeTestWidget
danielmolnar Jun 22, 2024
bc1de17
Adjust test to setup
danielmolnar Jun 22, 2024
a6d7389
Add test Poke test widget throws without defined tappable spots
danielmolnar Jun 22, 2024
3cce03c
Add docs to PokeTestWidget
danielmolnar Jun 22, 2024
6657c76
Improve test naming, constellation
danielmolnar Jun 24, 2024
c919bf1
Make captureConsoleOutput public
danielmolnar Jun 20, 2024
ef71574
Add test "Warn about using and finding alternative tappable area."
danielmolnar Jun 24, 2024
7df7e4f
Add todo
danielmolnar Jun 24, 2024
1f18195
Refactor act
danielmolnar Jun 24, 2024
f5df08d
Return HitTestFailure if no position is found
danielmolnar Jun 24, 2024
4ca1113
Fix test not running on flutter 3.10
danielmolnar Jun 24, 2024
9faf92c
Improve naming
danielmolnar Jun 24, 2024
7b4ca4d
Use positioned.fill instead of measure size
danielmolnar Jun 25, 2024
717b842
Create a useful error message when an InkWell covers the tap target
passsy Jun 25, 2024
1d93a41
Report useful error when tap target has 0x0 pixels in size
passsy Jun 26, 2024
531121f
Revert "Return HitTestFailure if no position is found"
danielmolnar Jun 26, 2024
b42d443
Improve getting the location of a widget in code using public APIs :t…
passsy Jun 27, 2024
8210279
Merge branch 'detect-pokable-positions' into tap-text-in-elevated-button
passsy Jun 27, 2024
3eff69e
Merge remote-tracking branch 'origin/main' into tap-text-in-elevated-…
passsy Jun 27, 2024
dc63f28
Delete MeasureSize
passsy Jun 27, 2024
f28a83c
Cleanup
passsy Jun 27, 2024
ac9b6d3
Print the actual widget, not the selector in tap error messages
passsy Jun 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add docs to PokeTestWidget
danielmolnar committed Jun 22, 2024
commit 3cce03cf656c00a41c00cabaaaae32c654d8e433
9 changes: 9 additions & 0 deletions test/widgets/poke_test_widget.dart
Original file line number Diff line number Diff line change
@@ -2,6 +2,11 @@ import 'package:flutter/material.dart';

import '../util/measure_size.dart';

/// Allows for simulating a widget's ability to receive tap events by covering
/// it entirely or partially. Coverage can be customized via
/// [PokeTestWidgetSetup]. Since the child's size is being calculated by
/// [MeasureSize], it's important to allow the widget to layout properly via
/// `await tester.pump()` before making any assertions.
class PokeTestWidget extends StatefulWidget {
const PokeTestWidget({
super.key,
@@ -66,6 +71,10 @@ class _PokeTestWidgetState extends State<PokeTestWidget> {
}
}

/// Setup for [PokeTestWidget].
/// Allows for defining a grid of squares that will cover `PokeTestWidget`'s
/// child. `pokeableAtRowIndex` and `pokeableAtColumnIndex` can be
/// used to define a single square that will allow taps to pass through.
class PokeTestWidgetSetup {
final int rows;
final int columns;