Skip to content

Commit

Permalink
feat: Added ImpaktfullUiTouchFeedback to control if the touch feedbac…
Browse files Browse the repository at this point in the history
…k can request focus
  • Loading branch information
vanlooverenkoen committed Jan 7, 2025
1 parent d71fa28 commit 4969db5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"rive_common","path":"/Users/vanlooverenkoen/.pub-cache/hosted/pub.dev/rive_common-0.4.11/","native_build":true,"dependencies":[]}],"android":[{"name":"rive_common","path":"/Users/vanlooverenkoen/.pub-cache/hosted/pub.dev/rive_common-0.4.11/","native_build":true,"dependencies":[]}],"macos":[{"name":"rive_common","path":"/Users/vanlooverenkoen/.pub-cache/hosted/pub.dev/rive_common-0.4.11/","native_build":true,"dependencies":[]}],"linux":[{"name":"rive_common","path":"/Users/vanlooverenkoen/.pub-cache/hosted/pub.dev/rive_common-0.4.11/","native_build":true,"dependencies":[]}],"windows":[{"name":"rive_common","path":"/Users/vanlooverenkoen/.pub-cache/hosted/pub.dev/rive_common-0.4.11/","native_build":true,"dependencies":[]}],"web":[{"name":"rive_common","path":"/Users/vanlooverenkoen/.pub-cache/hosted/pub.dev/rive_common-0.4.11/","dependencies":[]}]},"dependencyGraph":[{"name":"rive_common","dependencies":[]}],"date_created":"2025-01-07 13:03:13.258384","version":"3.24.4","swift_package_manager_enabled":false}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"rive_common","path":"/Users/vanlooverenkoen/.pub-cache/hosted/pub.dev/rive_common-0.4.11/","native_build":true,"dependencies":[]}],"android":[{"name":"rive_common","path":"/Users/vanlooverenkoen/.pub-cache/hosted/pub.dev/rive_common-0.4.11/","native_build":true,"dependencies":[]}],"macos":[{"name":"rive_common","path":"/Users/vanlooverenkoen/.pub-cache/hosted/pub.dev/rive_common-0.4.11/","native_build":true,"dependencies":[]}],"linux":[{"name":"rive_common","path":"/Users/vanlooverenkoen/.pub-cache/hosted/pub.dev/rive_common-0.4.11/","native_build":true,"dependencies":[]}],"windows":[{"name":"rive_common","path":"/Users/vanlooverenkoen/.pub-cache/hosted/pub.dev/rive_common-0.4.11/","native_build":true,"dependencies":[]}],"web":[{"name":"rive_common","path":"/Users/vanlooverenkoen/.pub-cache/hosted/pub.dev/rive_common-0.4.11/","dependencies":[]}]},"dependencyGraph":[{"name":"rive_common","dependencies":[]}],"date_created":"2025-01-07 14:54:11.015245","version":"3.24.4","swift_package_manager_enabled":false}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 0.28.0

## Feat

- Added ImpaktfullUiTouchFeedback `focusNode` to control if the touch feedback can request focus

# 0.27.0

## Feat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class ImpaktfullUiTouchFeedback extends StatelessWidget {
final MouseCursor cursor;
final List<BoxShadow> shadow;
final String? toolTip;
final FocusNode? focusNode;
final bool canRequestFocus;
final bool autofocus;
final bool useFocusColor;
Expand All @@ -38,6 +39,7 @@ class ImpaktfullUiTouchFeedback extends StatelessWidget {
this.color,
this.border,
this.toolTip,
this.focusNode,
this.cursor = SystemMouseCursors.click,
this.canRequestFocus = true,
this.autofocus = false,
Expand Down Expand Up @@ -77,6 +79,7 @@ class ImpaktfullUiTouchFeedback extends StatelessWidget {
canRequestFocus: canRequestFocus,
autofocus: autofocus,
useFocusColor: useFocusColor,
focusNode: focusNode,
onFocusChanged: _onFocusChanged,
child: child,
),
Expand Down Expand Up @@ -105,6 +108,7 @@ class _PlatformTouchFeedback extends StatefulWidget {
final bool canRequestFocus;
final bool autofocus;
final bool useFocusColor;
final FocusNode? focusNode;
final ValueChanged<bool> onFocusChanged;

const _PlatformTouchFeedback({
Expand All @@ -121,6 +125,7 @@ class _PlatformTouchFeedback extends StatefulWidget {
required this.autofocus,
required this.useFocusColor,
required this.onFocusChanged,
required this.focusNode,
});

@override
Expand All @@ -133,12 +138,14 @@ class _PlatformTouchFeedbackState extends State<_PlatformTouchFeedback> {
@override
void initState() {
super.initState();
_focusNode = FocusNode();
_focusNode = widget.focusNode ?? FocusNode();
}

@override
void dispose() {
_focusNode.dispose();
if (widget.focusNode == null) {
_focusNode.dispose();
}
super.dispose();
}

Expand Down

0 comments on commit 4969db5

Please sign in to comment.