Skip to content

Commit

Permalink
feat: add parameters to focusable
Browse files Browse the repository at this point in the history
  • Loading branch information
nank1ro committed Dec 2, 2024
1 parent fcb91fb commit 63cb479
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.16.1

- **FEAT**: Add parameters to `ShadFocusable`.

## 0.16.0

- **FEAT**: New `ShadTimePicker` and `ShadTimePickerFormField` components.
Expand Down
18 changes: 18 additions & 0 deletions lib/src/raw_components/focusable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ class ShadFocusable extends StatefulWidget {
this.autofocus = false,
this.child,
this.onFocusChange,
this.onKeyEvent,
this.skipTraversal,
this.descendantsAreFocusable,
this.descendantsAreTraversable,
this.includeSemantics = true,
this.debugLabel,
});

final bool canRequestFocus;
Expand All @@ -23,6 +29,12 @@ class ShadFocusable extends StatefulWidget {
final FocusWidgetBuilder builder;
final Widget? child;
final ValueChanged<bool>? onFocusChange;
final FocusOnKeyEventCallback? onKeyEvent;
final bool? skipTraversal;
final bool? descendantsAreFocusable;
final bool? descendantsAreTraversable;
final bool includeSemantics;
final String? debugLabel;

@override
State<ShadFocusable> createState() => _ShadFocusableState();
Expand Down Expand Up @@ -63,6 +75,12 @@ class _ShadFocusableState extends State<ShadFocusable> {
canRequestFocus: widget.canRequestFocus,
onFocusChange: (value) => isFocused.value = value,
focusNode: focusNode,
onKeyEvent: widget.onKeyEvent,
skipTraversal: widget.skipTraversal,
descendantsAreFocusable: widget.descendantsAreFocusable,
descendantsAreTraversable: widget.descendantsAreTraversable,
includeSemantics: widget.includeSemantics,
debugLabel: widget.debugLabel,
child: ValueListenableBuilder(
valueListenable: isFocused,
builder: (context, value, child) =>
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: shadcn_ui
description: shadcn-ui ported in Flutter. Awesome UI components for Flutter, fully customizable.
version: 0.16.0
version: 0.16.1
homepage: https://flutter-shadcn-ui.mariuti.com
repository: https://github.com/nank1ro/flutter-shadcn-ui
documentation: https://flutter-shadcn-ui.mariuti.com
Expand Down

0 comments on commit 63cb479

Please sign in to comment.