Skip to content

Commit

Permalink
fix: input otp rtl (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
nank1ro authored Jan 21, 2025
1 parent 59de220 commit e3ed3ae
Show file tree
Hide file tree
Showing 3 changed files with 8 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.18.2

- **FIX**: `InputOTP` component with RTL directionality.

## 0.18.1

- **FIX**: Set `ShadCard` clipBehavior to `Clip.antialias`, add `clipBehavior` to `ShadCard` and `ShadCardTheme`.
Expand Down
3 changes: 3 additions & 0 deletions lib/src/components/input_otp.dart
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ class ShadInputOTPState extends State<ShadInputOTP> {
child: ShadDisabled(
disabled: !widget.enabled,
child: Row(
textDirection: TextDirection.ltr,
mainAxisSize: MainAxisSize.min,
children: widget.children.separatedBy(SizedBox(width: effectiveGap)),
),
Expand Down Expand Up @@ -240,6 +241,7 @@ class _ShadInputOTPGroupState extends State<ShadInputOTPGroup> {
@override
Widget build(BuildContext context) {
return Row(
textDirection: TextDirection.ltr,
mainAxisSize: MainAxisSize.min,
children: widget.children,
);
Expand Down Expand Up @@ -439,6 +441,7 @@ class _ShadInputOTPSlotState extends State<ShadInputOTPSlot> {

final lastIndexForGroup = otpProvider.widget.maxLength / otpProvider.groups;
final isLastInGroup = (index + 1) % lastIndexForGroup == 0;

final isFirstInGroup = index % lastIndexForGroup == 0;

final BorderRadius effectiveRadius;
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.18.1
version: 0.18.2
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 e3ed3ae

Please sign in to comment.