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

Wrong hour/minute order in timePicker in RTL mode #63427

Closed
mehrdad-shokri opened this issue Aug 10, 2020 · 20 comments · Fixed by #63599 or #64097
Closed

Wrong hour/minute order in timePicker in RTL mode #63427

mehrdad-shokri opened this issue Aug 10, 2020 · 20 comments · Fixed by #63599 or #64097
Labels
a: internationalization Supporting other languages or locales. (aka i18n) a: quality A truly polished experience f: date/time picker Date or time picker widgets f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Comments

@mehrdad-shokri
Copy link

Hour and Minute order are wrong in RTL mode. It is just reversed from left -> right to right -> left.
Hour view is same in both RTL and LTR meaning hour comes on the left and minute comes on the right.
To reproduce the problem set locale in MaterialApp to an rtl locale (like Locale('fa')); and call showTimePicker(context:context, initialTime: TimeOfDay.now());
screenshot-2020-08-11_01 50 05 949

@mehrdad-shokri mehrdad-shokri added the from: performance template Issues created via a performance issue template label Aug 10, 2020
@mehrdad-shokri
Copy link
Author

For now I solved it by:

                    builder: (BuildContext context, Widget child) {
                      return Directionality(
                        textDirection: TextDirection.ltr,
                        child: child,
                      );
                    }

@liyuqian liyuqian added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Aug 10, 2020
@liyuqian
Copy link
Contributor

This does not seem to be a performance issue. @HansMuller : do you know if someone in the design language team can take a look at this?

@mehrdad-shokri
Copy link
Author

@liyuqian yes it's not. my previous workaround also didn't work because it took action bottoms to the right which is wrong direction.

@TahaTesser TahaTesser removed the from: performance template Issues created via a performance issue template label Aug 11, 2020
@TahaTesser
Copy link
Member

@mehrdad-shokri
Can you please provide your flutter doctor -v
Thank you

@TahaTesser TahaTesser added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Aug 11, 2020
@mehrdad-shokri
Copy link
Author

@TahaTesser sure

▶ flutter doctor -v
[✓] Flutter (Channel master, 1.20.0, on Linux, locale en_US.UTF-8)
    • Flutter version 1.20.0 at /home/mehrdad/flutter
    • Framework revision c68758fab1 (7 weeks ago), 2020-06-24 21:23:02 -0700
    • Engine revision 0c14126211
    • Dart version 2.9.0 (build 2.9.0-18.0.dev d8eb844e5d)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /home/mehrdad/Android/Sdk
    • Platform android-29, build-tools 29.0.3
    • ANDROID_HOME = /home/mehrdad/Android/Sdk
    • Java binary at: /opt/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Android Studio (version 3.6)
    • Android Studio at /opt/android-studio
    • Flutter plugin version 44.0.2
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build
      1.8.0_212-release-1586-b4-5784211)

[✓] VS Code (version 1.47.3)
    • VS Code at /usr/share/code
    • Flutter extension version 3.9.1

[✓] Connected device (1 available)
    • Samsung Galaxy S10 • 192.168.59.102:5555 • android-x86 • Android 10 (API
      29)

• No issues found!

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Aug 11, 2020
@TahaTesser
Copy link
Member

Hi @mehrdad-shokri
That looks to be quite a old master channel

Can you upgrade to latest master and try again
flutter channel master
flutter upgrade --force
flutter doctor -v

@TahaTesser TahaTesser added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Aug 11, 2020
@mehrdad-shokri
Copy link
Author

@TahaTesser After upgrading flutter it's now fixed on dial mode, but it's still reverse on the input mode.
screenshot-2020-08-12_08 34 58 851
screenshot-2020-08-12_08 35 09 001


▶ flutter doctor -v
[✓] Flutter (Channel master, 1.21.0-8.0.pre.175, on Linux, locale en_US.UTF-8)
    • Flutter version 1.21.0-8.0.pre.175 at /home/mehrdad/flutter
    • Framework revision 4a1a0c1e22 (73 minutes ago), 2020-08-11 22:46:02 -0400
    • Engine revision 9893a29366
    • Dart version 2.10.0 (build 2.10.0-11.0.dev)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /home/mehrdad/Android/Sdk
    • Platform android-29, build-tools 29.0.3
    • ANDROID_HOME = /home/mehrdad/Android/Sdk
    • Java binary at: /opt/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Android Studio (version 3.6)
    • Android Studio at /opt/android-studio
    • Flutter plugin version 44.0.2
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] VS Code (version 1.47.3)
    • VS Code at /usr/share/code
    • Flutter extension version 3.9.1

[✓] Connected device (1 available)
    • Samsung Galaxy S10 (mobile) • 192.168.59.102:5555 • android-x86 • Android 10 (API 29)

• No issues found!

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Aug 12, 2020
@mehrdad-shokri
Copy link
Author

It doesn't also accept a valid hour/minute on the input mode.
screenshot-2020-08-12_12 02 48 084

@TahaTesser TahaTesser added a: internationalization Supporting other languages or locales. (aka i18n) a: quality A truly polished experience f: date/time picker Date or time picker widgets labels Aug 12, 2020
@HansMuller
Copy link
Contributor

CC @rami-a @darrenaustin

@rami-a
Copy link
Member

rami-a commented Aug 12, 2020

This is a duplicate of #62775 and is fixed on master. We've also requested that the fix be cherry-picked into stable.

@rami-a rami-a closed this as completed Aug 12, 2020
@mehrdad-shokri
Copy link
Author

@rami-a I'm on master channel and updated ~10 hours ago and still have the problem

@mehrdad-shokri
Copy link
Author

@rami-a to be more clear it is fixed on dial mode but still this is the problem on input mode

@rami-a
Copy link
Member

rami-a commented Aug 12, 2020

ah sorry you're right, I must have missed the input mode. I'll create a fix for this

@rami-a rami-a reopened this Aug 12, 2020
@mehrdad-shokri
Copy link
Author

@rami-a very thanks.

@mehrdad-shokri
Copy link
Author

thank you very much @rami-a is this update available on master channel now?

@mehrdad-shokri
Copy link
Author

Updated flutter and confirm it is fixed, but there are 2 issues. Fist padding-bottom of action buttons in input mode is less than dial mode padding. Also why inserting English digits is not a valid time? I think it's a bug too

screenshot-2020-08-14_16 03 54 542
screenshot-2020-08-14_16 03 32 392

@rami-a
Copy link
Member

rami-a commented Aug 14, 2020

Oh that's very interesting, I'll have to take a look. Could you please file this is a separate issue @mehrdad-shokri? Since this one is closed and is specific to RTL order. Thanks!

@rami-a rami-a reopened this Aug 18, 2020
@rami-a
Copy link
Member

rami-a commented Aug 18, 2020

My fix had to be reverted in #64094 (review) since it caused the ":" to not be aligned properly. Creating a new fix now

@rami-a
Copy link
Member

rami-a commented Aug 19, 2020

New fix has landed and should be the one that is cherry-picked if possible

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: internationalization Supporting other languages or locales. (aka i18n) a: quality A truly polished experience f: date/time picker Date or time picker widgets f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
6 participants