Make the AbsorbPointer sample show the difference from IgnorePointer - #188940
auto-submit[bot] merged 7 commits into
Conversation
|
Thanks for the early review @navaronbracke! All four points addressed in 6e5e3af — the example now uses only widgets-library APIs (WidgetsApp + GestureDetector/Container targets, modeled on the tap_region example), the test imports package:flutter/widgets.dart, and both test comments use your suggested wording. Tests still 2/2 and the analyzer is clean. (Still a draft only because of the open-PR limit — happy to keep iterating meanwhile.) |
There was a problem hiding this comment.
Code Review
This pull request updates the AbsorbPointer sample code, documentation, and tests to showcase both AbsorbPointer and IgnorePointer side-by-side. The reviewer recommends reverting the import to material.dart and refactoring the implementation to use MaterialApp and ElevatedButton instead of WidgetsApp and custom containers. This simplifies the code, restores built-in tap feedback, and resolves compilation errors caused by invalid leading-dot syntax.
victorsanni
left a comment
There was a problem hiding this comment.
Hi @theprantadutta, can you fix the merge conflicts in this PR, then re-request a review to get this PR back on my queue? Thanks!
|
@victorsanni conflicts are resolved in e419044 — this is ready for another look. The conflict came from the
I can't use GitHub's re-request-review button — as a non-collaborator I get a permissions error on One note for whenever you get to it: the |
navaronbracke
left a comment
There was a problem hiding this comment.
I think this needs to be removed from this as well https://github.com/flutter/flutter/blob/master/dev/bots/check_examples_cross_imports.dart#L270
https://github.com/flutter/flutter/blob/master/dev/bots/check_examples_cross_imports.dart#L472
victorsanni
left a comment
There was a problem hiding this comment.
Can you remove the file from check_examples_cross_imports.dart as @navaronbracke suggested?
…e its labels a color The sample and its test no longer import Material, so they no longer belong in knownExamplesCrossImports. WidgetsApp does not install a DefaultTextStyle, so the section titles and tap counters were falling back to a style with no color and rendering invisibly against the white background. Set WidgetsApp.textStyle so they are legible.
|
Done in f9555b0 — removed both entries from Verified by running the checker itself: Thanks @navaronbracke for pointing at the exact lines. |
victorsanni
left a comment
There was a problem hiding this comment.
LGTM with one comment.
05033f4
|
autosubmit label was removed for flutter/flutter/188940, because This PR has not met approval requirements for merging. The PR author is not a member of flutter-hackers and needs 2 more review(s) in order to merge this PR.
|
|
Thanks for the approval @victorsanni, and for the @navaronbracke, a heads-up you probably can't see from the timeline: your approval from Aug 23 was auto-dismissed when the later commits landed (the For context on why I'm asking rather than waiting: the auto-submit bot removed the Everything else is green on my side: no conflicts, all review threads answered, and the example analyzes, formats and tests clean. |
|
Thanks for the re-approval @navaronbracke 🙏 This looks ready to go now — two approvals on the current head ( The only thing left is the |
flutter/flutter@8d8c1aa...c978386 2026-08-30 engine-flutter-autoroll@skia.org Roll Skia from ce359c7fbfe6 to 588b550a4dd8 (1 revision) (flutter/flutter#192040) 2026-08-30 engine-flutter-autoroll@skia.org Roll Skia from 3ae8e3d1e335 to ce359c7fbfe6 (1 revision) (flutter/flutter#192037) 2026-08-30 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from J123CwfDPYyVDpkMl... to o9DikEfRoFyVK3LKD... (flutter/flutter#192031) 2026-08-29 44747303+theprantadutta@users.noreply.github.com Make the AbsorbPointer sample show the difference from IgnorePointer (flutter/flutter#188940) 2026-08-29 engine-flutter-autoroll@skia.org Roll Dart SDK from 391ff83cd1d3 to 76abdf94faa8 (1 revision) (flutter/flutter#192021) 2026-08-29 engine-flutter-autoroll@skia.org Roll Skia from b392fb672d13 to 3ae8e3d1e335 (1 revision) (flutter/flutter#192020) 2026-08-29 engine-flutter-autoroll@skia.org Roll Skia from 0b4249b26b38 to b392fb672d13 (6 revisions) (flutter/flutter#192016) 2026-08-29 97480502+b-luk@users.noreply.github.com Fixes for texture-backed gradients (flutter/flutter#191925) 2026-08-29 engine-flutter-autoroll@skia.org Roll Dart SDK from ae63a6eca3f1 to 391ff83cd1d3 (3 revisions) (flutter/flutter#192010) 2026-08-29 166619967+ik020@users.noreply.github.com Fix Android license detection for cmdline-tools 23.0+ (flutter/flutter#191554) 2026-08-29 bkonyi@google.com [flutter_tools] Pause web server requests until initial compilation finishes (flutter/flutter#191990) 2026-08-28 codefu@google.com fix(workflow): Mac Verify Binaries needs `Linux mac_android_aot_engine` (flutter/flutter#191999) 2026-08-28 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from dDxH8G5cDBP602eyG... to J123CwfDPYyVDpkMl... (flutter/flutter#191984) 2026-08-28 katelovett@google.com Update scheduled workflow for more tasks, add goldctl update (flutter/flutter#191991) 2026-08-28 katelovett@google.com Update no-main-prs to leave a comment (flutter/flutter#191973) 2026-08-28 269567208+reidbaker-agent@users.noreply.github.com [AGP 9.1.0 Migration #4] Replace plugin build-type copy with initWith on public DSL (flutter/flutter#191606) 2026-08-28 engine-flutter-autoroll@skia.org Roll Skia from fe0b9a5261f9 to 0b4249b26b38 (1 revision) (flutter/flutter#191974) 2026-08-28 louisehsu@google.com [UIScene] Migrate dev/benchmarks/macrobenchmarks to UIScene lifecycle (flutter/flutter#191648) 2026-08-28 louisehsu@google.com Uiscene migrate remaining apps (flutter/flutter#191652) 2026-08-28 bkonyi@google.com [tool] Migrate SymbolizeCommand to modular dependency injection (flutter/flutter#190744) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC bmparr@google.com,stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…r#12693) flutter/flutter@8d8c1aa...c978386 2026-08-30 engine-flutter-autoroll@skia.org Roll Skia from ce359c7fbfe6 to 588b550a4dd8 (1 revision) (flutter/flutter#192040) 2026-08-30 engine-flutter-autoroll@skia.org Roll Skia from 3ae8e3d1e335 to ce359c7fbfe6 (1 revision) (flutter/flutter#192037) 2026-08-30 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from J123CwfDPYyVDpkMl... to o9DikEfRoFyVK3LKD... (flutter/flutter#192031) 2026-08-29 44747303+theprantadutta@users.noreply.github.com Make the AbsorbPointer sample show the difference from IgnorePointer (flutter/flutter#188940) 2026-08-29 engine-flutter-autoroll@skia.org Roll Dart SDK from 391ff83cd1d3 to 76abdf94faa8 (1 revision) (flutter/flutter#192021) 2026-08-29 engine-flutter-autoroll@skia.org Roll Skia from b392fb672d13 to 3ae8e3d1e335 (1 revision) (flutter/flutter#192020) 2026-08-29 engine-flutter-autoroll@skia.org Roll Skia from 0b4249b26b38 to b392fb672d13 (6 revisions) (flutter/flutter#192016) 2026-08-29 97480502+b-luk@users.noreply.github.com Fixes for texture-backed gradients (flutter/flutter#191925) 2026-08-29 engine-flutter-autoroll@skia.org Roll Dart SDK from ae63a6eca3f1 to 391ff83cd1d3 (3 revisions) (flutter/flutter#192010) 2026-08-29 166619967+ik020@users.noreply.github.com Fix Android license detection for cmdline-tools 23.0+ (flutter/flutter#191554) 2026-08-29 bkonyi@google.com [flutter_tools] Pause web server requests until initial compilation finishes (flutter/flutter#191990) 2026-08-28 codefu@google.com fix(workflow): Mac Verify Binaries needs `Linux mac_android_aot_engine` (flutter/flutter#191999) 2026-08-28 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from dDxH8G5cDBP602eyG... to J123CwfDPYyVDpkMl... (flutter/flutter#191984) 2026-08-28 katelovett@google.com Update scheduled workflow for more tasks, add goldctl update (flutter/flutter#191991) 2026-08-28 katelovett@google.com Update no-main-prs to leave a comment (flutter/flutter#191973) 2026-08-28 269567208+reidbaker-agent@users.noreply.github.com [AGP 9.1.0 Migration flutter#4] Replace plugin build-type copy with initWith on public DSL (flutter/flutter#191606) 2026-08-28 engine-flutter-autoroll@skia.org Roll Skia from fe0b9a5261f9 to 0b4249b26b38 (1 revision) (flutter/flutter#191974) 2026-08-28 louisehsu@google.com [UIScene] Migrate dev/benchmarks/macrobenchmarks to UIScene lifecycle (flutter/flutter#191648) 2026-08-28 louisehsu@google.com Uiscene migrate remaining apps (flutter/flutter#191652) 2026-08-28 bkonyi@google.com [tool] Migrate SymbolizeCommand to modular dependency injection (flutter/flutter#190744) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC bmparr@google.com,stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…r#12693) flutter/flutter@8d8c1aa...c978386 2026-08-30 engine-flutter-autoroll@skia.org Roll Skia from ce359c7fbfe6 to 588b550a4dd8 (1 revision) (flutter/flutter#192040) 2026-08-30 engine-flutter-autoroll@skia.org Roll Skia from 3ae8e3d1e335 to ce359c7fbfe6 (1 revision) (flutter/flutter#192037) 2026-08-30 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from J123CwfDPYyVDpkMl... to o9DikEfRoFyVK3LKD... (flutter/flutter#192031) 2026-08-29 44747303+theprantadutta@users.noreply.github.com Make the AbsorbPointer sample show the difference from IgnorePointer (flutter/flutter#188940) 2026-08-29 engine-flutter-autoroll@skia.org Roll Dart SDK from 391ff83cd1d3 to 76abdf94faa8 (1 revision) (flutter/flutter#192021) 2026-08-29 engine-flutter-autoroll@skia.org Roll Skia from b392fb672d13 to 3ae8e3d1e335 (1 revision) (flutter/flutter#192020) 2026-08-29 engine-flutter-autoroll@skia.org Roll Skia from 0b4249b26b38 to b392fb672d13 (6 revisions) (flutter/flutter#192016) 2026-08-29 97480502+b-luk@users.noreply.github.com Fixes for texture-backed gradients (flutter/flutter#191925) 2026-08-29 engine-flutter-autoroll@skia.org Roll Dart SDK from ae63a6eca3f1 to 391ff83cd1d3 (3 revisions) (flutter/flutter#192010) 2026-08-29 166619967+ik020@users.noreply.github.com Fix Android license detection for cmdline-tools 23.0+ (flutter/flutter#191554) 2026-08-29 bkonyi@google.com [flutter_tools] Pause web server requests until initial compilation finishes (flutter/flutter#191990) 2026-08-28 codefu@google.com fix(workflow): Mac Verify Binaries needs `Linux mac_android_aot_engine` (flutter/flutter#191999) 2026-08-28 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from dDxH8G5cDBP602eyG... to J123CwfDPYyVDpkMl... (flutter/flutter#191984) 2026-08-28 katelovett@google.com Update scheduled workflow for more tasks, add goldctl update (flutter/flutter#191991) 2026-08-28 katelovett@google.com Update no-main-prs to leave a comment (flutter/flutter#191973) 2026-08-28 269567208+reidbaker-agent@users.noreply.github.com [AGP 9.1.0 Migration flutter#4] Replace plugin build-type copy with initWith on public DSL (flutter/flutter#191606) 2026-08-28 engine-flutter-autoroll@skia.org Roll Skia from fe0b9a5261f9 to 0b4249b26b38 (1 revision) (flutter/flutter#191974) 2026-08-28 louisehsu@google.com [UIScene] Migrate dev/benchmarks/macrobenchmarks to UIScene lifecycle (flutter/flutter#191648) 2026-08-28 louisehsu@google.com Uiscene migrate remaining apps (flutter/flutter#191652) 2026-08-28 bkonyi@google.com [tool] Migrate SymbolizeCommand to modular dependency injection (flutter/flutter#190744) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC bmparr@google.com,stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
The
AbsorbPointersample shows two overlapping buttons in aStack, but neither button gives any visible feedback when tapped, so the sample doesn't let you observe whatAbsorbPointeractually does — and as #87936 points out, it especially doesn't show how it differs fromIgnorePointer.This implements the design discussed on the issue (keep the existing example, add an
IgnorePointercounterpart so the side-by-side makes the distinction observable — suggested by @victorsanni):AbsorbPointer, the other inIgnorePointer, with a visible "Taps received" counter under each stack.AbsorbPointerside does nothing — theAbsorbPointerabsorbs the pointer events itself, so neither its child button nor the button behind it receives the tap. Tapping the same region on theIgnorePointerside increments the counter of the button behind — theIgnorePointeris invisible to hit testing, so the event goes through to the next target in the stack.{@tool dartpad}blurb on theAbsorbPointerclass docs is updated to describe the comparison.AbsorbPointerstill receives taps), replacing the previous mouse-cursor-only check.Fixes #87936
Pre-launch Checklist
///).