I want to automatically capitalize the first letter when the user enters the first name. I use
` TextFormField(
textCapitalization: TextCapitalization.words
)`
works fine on IOS, but not on Android emulators or real phones.
use textCapitalization: TextCapitalization.words, expecting to capitalize the first letter both IOS and Android. Actual situation: Only IOS works normally;
- Doctor summary (to see all details, run flutter doctor -v):
- Flutter (Channel stable, 3.7.8, on macOS 13.2.1, 22D68, darwin-arm64, locale zh-Hans-AU)
- Android toolchain: develop for Android devices (Android SDK version 33.0.2)
- Xcode: develop for iOS and macOS (Xcode 14.2)
- Chrome: develop for the web
- Android Studio (version 2022.1)
- VS Code (version 1.82.0)
- Connected device (6 available)
- Device emulator 5556 is offline.
- HTTP Host Availability
- No issues were found!
To ensure consistent capitalization behaviour across both iOS and Android platforms, you can manually capitalize the first letter of the input text using a
TextEditingControllerand theonChangedcallback.