Repository: flutter
Issue: [iOS] TextFormField TextCapitalization.words is wrong when characters is selected
Labels: a: text input,platform-ios,framework,engine,has reproducible steps,P2,found in release: 3.10,found in release: 3.11,team-ios,triaged-ios

### Is there an existing issue for this?

- [X] I have searched the [existing issues](https://github.com/flutter/flutter/issues)
- [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports)

### Steps to reproduce

On a Flutter app for Android or iOS:

1. Create a simple `TextFormField` as followed:

```Dart
TextFormField(
  textCapitalization: TextCapitalization.words,
  textInputAction: TextInputAction.done,
),
```

2. Now when you run the app, in the TextFormField, enter the word: `Example`
3. Now select the last characters of that word, for example: `ample`
4. Type something, for example: `pect`

### Expected results

Because I use `textCapitalization: TextCapitalization.words`, I expect to type `pect`, all in lowercase, because I started typing in the middle of the word.

### Actual results

I actually type `Pect`, with the first character in uppercase and the virtual keyboard in uppercase mode for that character.

### Code sample

<details><summary>Code sample</summary>

(Works only on Android / iOS)
https://dartpad.dev/?id=e75b493dae1287757c5e1d77a0dc73f1

</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>


### Logs

<details><summary>Logs</summary>

```console
[Paste your logs here]
```

</details>


### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.10.2, on macOS 13.2 22D49 darwin-arm64, locale fr-FR)
    • Flutter version 3.10.2 on channel stable at /Users/mregnauld/FlutterSDK/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 9cd3d0d9ff (7 days ago), 2023-05-23 20:57:28 -0700
    • Engine revision 90fa3ae28f
    • Dart version 3.0.2
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc1)
    • Android SDK at /Users/mregnauld/AndroidSDK
    • Platform android-33, build-tools 33.0.0-rc1
    • ANDROID_HOME = /Users/mregnauld/AndroidSDK
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.77.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.60.0

[✓] Connected device (3 available)
    • iPhone de Matthieu (mobile) • 00008030-001C085222DA802E • ios            • iOS 16.2 20C65
    • macOS (desktop)             • macos                     • darwin-arm64   • macOS 13.2 22D49 darwin-arm64
    • Chrome (web)                • chrome                    • web-javascript • Google Chrome 113.0.5672.126

[✓] Network resources
    • All expected network resources are available.

• No issues found!

```

</details>