Skip to content

Commit 652be0f

Browse files
authored
Merge pull request #5 from mrn/main
Add hit test behavior parameter
2 parents 22b6388 + 346e75d commit 652be0f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/src/bounceable.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class Bounceable extends StatefulWidget {
2222
/// The scale factor of the child widget. The valid range of `scaleFactor` is from `0.0` to `1.0`.
2323
final double scaleFactor;
2424

25+
/// How the internal gesture detector should behave during hit testing.
26+
final HitTestBehavior? hitTestBehavior;
27+
2528
final Widget child;
2629

2730
const Bounceable({
@@ -36,6 +39,7 @@ class Bounceable extends StatefulWidget {
3639
this.curve = Curves.decelerate,
3740
this.reverseCurve = Curves.decelerate,
3841
this.scaleFactor = 0.8,
42+
this.hitTestBehavior,
3943
}) : assert(
4044
scaleFactor >= 0.0 && scaleFactor <= 1.0,
4145
"The valid range of scaleFactor is from 0.0 to 1.0.",
@@ -102,6 +106,7 @@ class _BounceableState extends State<Bounceable>
102106
return MouseRegion(
103107
cursor: SystemMouseCursors.click,
104108
child: GestureDetector(
109+
behavior: widget.hitTestBehavior,
105110
onTapCancel: widget.onTap != null ? _onTapCancel : null,
106111
onTapDown: widget.onTap != null ? _onTapDown : null,
107112
onTapUp: widget.onTap != null ? _onTapUp : null,

0 commit comments

Comments
 (0)