Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: input otp rtl #251

Merged
merged 5 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading