Repository: flutter
Issue: [macOS] IME backspace fails to ignore decorational spaces
Labels: a: text input,platform-mac,a: desktop,P2,fyi-text-input,team-macos,triaged-macos

During an IME composition, the precompose text might be inserted with decorational spaces. Pressing backspace should ignore these spaces, but Flutter does not.

Target app: a text field

Step:

1. Use macOS's Chinese Pinyin IME
2. Press `W` for 3 times. The precompose text is now `w w w` (notice the space in between.)
3. Press back space.
  - Expected: Pressing backspace for 3 times should clear the precompose text.
  - Actual: Pressing backspace for 5 times clears the precompose text.

Record from Flutter: 
![2](https://user-images.githubusercontent.com/1596656/137410784-a7be3d89-7ed6-4c75-bbd5-9c539241c695.gif)
(This video also shows that the candidate list does not react to backspaces, which is a separate issue filed at https://github.com/flutter/flutter/issues/91859 .)

Record from macOS's Notes:
![3](https://user-images.githubusercontent.com/1596656/137410809-ab3bf1a2-98ea-4d15-9f90-8eeffcee6c14.gif)

Version:
<details><pre>
[✓] Flutter (Channel master, 2.6.0-12.0.pre.355, on macOS 11.6 20G165 darwin-x64, locale en)
    • Flutter version 2.6.0-12.0.pre.355 at /Users/tongmu/dev/flutter
    • Upstream repository git@github.com:flutter/flutter.git
    • Framework revision ccc8261495 (30 minutes ago), 2021-10-14 15:33:05 -0500
    • Engine revision 8a18794648
    • Dart version 2.15.0 (build 2.15.0-217.0.dev)

[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/tongmu/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[!] Xcode - develop for iOS and macOS (Xcode 13.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    ! CocoaPods 1.9.1 out of date (1.10.0 is recommended).
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 3.3)
    • 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 1.8.0_152-release-1248-b01)

[✓] VS Code (version 1.61.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.27.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 11.6 20G165 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 94.0.4606.81

! Doctor found issues in 2 categories.
</pre></details>