Skip to content

Commit

Permalink
feat: Added ImpaktfullUiIconButton to control if the icon button can …
Browse files Browse the repository at this point in the history
…request focus

Added ImpaktfullUiButton  to control if the button can request focus
  • Loading branch information
vanlooverenkoen committed Jan 7, 2025
1 parent b6b620c commit e5ed357
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
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 12:54:18.693767","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 13:03:13.258384","version":"3.24.4","swift_package_manager_enabled":false}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 0.27.0

## Feat

- Added ImpaktfullUiIconButton `canRequestFocus` to control if the icon button can request focus
- Added ImpaktfullUiButton `canRequestFocus` to control if the button can request focus

# 0.26.0

## Feat
Expand Down
3 changes: 3 additions & 0 deletions lib/src/components/button/button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class ImpaktfullUiButton extends StatefulWidget with ComponentDescriptorMixin {
final Widget? trailingChild;
final bool isLoading;
final bool fullWidth;
final bool canRequestFocus;
final AsyncCallback? onAsyncTap;
final VoidCallback? onTap;
final ImpaktfullUiButtonTheme? theme;
Expand All @@ -39,6 +40,7 @@ class ImpaktfullUiButton extends StatefulWidget with ComponentDescriptorMixin {
this.trailingChild,
this.fullWidth = false,
this.isLoading = false,
this.canRequestFocus = true,
this.onTap,
this.onAsyncTap,
this.theme,
Expand Down Expand Up @@ -71,6 +73,7 @@ class _ImpaktfullUiButtonState extends State<ImpaktfullUiButton> {
opacity: isClickable ? 1 : 0.5,
child: ImpaktfullUiTouchFeedback(
color: backgroundColor,
canRequestFocus: widget.canRequestFocus,
borderRadius: componentTheme.dimens.borderRadius,
border: borderColor == null
? null
Expand Down
4 changes: 4 additions & 0 deletions lib/src/components/icon_button/icon_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ class ImpaktfullUiIconButton extends StatelessWidget
final double size;
final String? tooltip;
final Color? backgroundColor;
final bool canRequestFocus;

const ImpaktfullUiIconButton({
required this.onTap,
required this.asset,
this.color,
this.size = 16,
this.backgroundColor,
this.tooltip,
this.canRequestFocus = true,
super.key,
});

Expand All @@ -32,6 +35,7 @@ class ImpaktfullUiIconButton extends StatelessWidget
borderRadius: BorderRadius.circular(9999),
onTap: onTap,
color: backgroundColor,
canRequestFocus: canRequestFocus,
child: Padding(
padding: const EdgeInsets.all(12),
child: ImpaktfullUiAssetWidget(
Expand Down

0 comments on commit e5ed357

Please sign in to comment.