-
Notifications
You must be signed in to change notification settings - Fork 29.1k
Description
Steps to Reproduce
- Run
flutter create bug
. - Create a simple widget
- Add a
TextFormField
orTextField
widget withtextDirection: TextDirection.rtl
- Print trimmed value inside
onChanged
Expected results:
I expect when i call trim()
on the value of the text field returned from onChanged
or controller.text
, it should get trimmed.
when i type " str ", "str ", " str" it should remove the leading and trailing whitespaces and return: 'str'
Actual results:
It does not get trimmed correctly if textDirection: TextDirection.rtl
, but, it works just fine if textDirection: TextDirection.ltr
.
Here is a working demo of the bug:
https://dartpad.dev/b6130da3c610e01d4cc2ddf0ab278d3e
Logs
No exceptions
Analyzing bug...
No issues found! (ran in 3.4s)
[✓] Flutter (Channel stable, 1.20.4, on Microsoft Windows [Version 10.0.19041.508], locale en-US)
• Flutter version 1.20.4 at X:\Development\Configurations\flutter
• Framework revision fba99f6 (4 weeks ago), 2020-09-14 15:32:52 -0700
• Engine revision d1bc06f032
• Dart version 2.9.2
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at X:\Development\Configurations\android\sdk
• Platform android-30, build-tools 30.0.2
• ANDROID_HOME = X:\Development\Configurations\android\sdk
• ANDROID_SDK_ROOT = X:\Development\Configurations\android\sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.
[✓] Android Studio (version 4.0)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 48.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[✓] VS Code (version 1.50.0)
• VS Code at C:\Users\USR\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.15.0
[✓] Connected device (1 available)
• Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)
• No issues found!