From ec0c5b2f6f8760d73bef8d43bac49099c6be42d8 Mon Sep 17 00:00:00 2001 From: Erick Date: Thu, 21 Dec 2023 13:14:01 -0300 Subject: [PATCH] feat: add behavior to NesPressable (#110) --- CHANGELOG.md | 1 + lib/src/widgets/nes_pressabled.dart | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c840247..07264b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # 0.12.0 - feat: adding `NesBlinker`. - fix: `NesRunningText` would not update its text. + - feat: add `HitTestBehavior` property to `NesPressable`. # 0.11.0 - feat: add ability to customize `NesContainer`s pixel sizes. diff --git a/lib/src/widgets/nes_pressabled.dart b/lib/src/widgets/nes_pressabled.dart index 53dca25..c77c985 100644 --- a/lib/src/widgets/nes_pressabled.dart +++ b/lib/src/widgets/nes_pressabled.dart @@ -13,6 +13,7 @@ class NesPressable extends StatefulWidget { this.onPressEnd, this.onPress, this.disabled, + this.behavior, super.key, }); @@ -31,6 +32,9 @@ class NesPressable extends StatefulWidget { /// Child. final Widget child; + /// The behavior of the hit test of this widget. + final HitTestBehavior? behavior; + @override State createState() => _NesPressableState(); } @@ -50,6 +54,7 @@ class _NesPressableState extends State { child: MouseRegion( cursor: SystemMouseCursors.click, child: GestureDetector( + behavior: widget.behavior, onTap: () { widget.onPress?.call(); },