Repository: flutter
Issue: macOS : updateEditingValue is not getting called upon typing Chinese or Non-English language.
Labels: a: text input,framework,engine,platform-mac,a: internationalization,a: desktop,has reproducible steps,P2,found in release: 3.7,found in release: 3.10,fyi-text-input,team-macos,triaged-macos

### 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

when i input Chinese word，updateEditingValue will not be callback, but when is english is normal. in windows platform is ok.
and i propose has a function to set the position of Candidate Window 

<img width="441" alt="image" src="https://user-images.githubusercontent.com/112080579/232486834-d20344d9-b817-4c2c-bab5-77a67ad2a9fb.png">


### Expected results

<img width="441" alt="image" src="https://user-images.githubusercontent.com/112080579/232486914-569adc4e-7d18-4338-8aa0-5a10a4706fd4.png">


### Actual results

null

### Code sample

<details><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or simply save your changes to "hot reload" in a Flutter IDE).
        // Notice that the counter didn't reset back to zero; the application
        // is not restarted.
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(
          title: 'Flutter Demo Home Page',
          focusNode: FocusNode(debugLabel: 'text page')),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({super.key, required this.title, this.focusNode});

  // This widget is the home page of your application. It is stateful, meaning
  // that it has a State object (defined below) that contains fields that affect
  // how it looks.

  // This class is the configuration for the state. It holds the values (in this
  // case the title) provided by the parent (in this case the App widget) and
  // used by the build method of the State. Fields in a Widget subclass are
  // always marked "final".
  final FocusNode? focusNode;
  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> with TextInputClient {
  int _counter = 0;

  late double _pixelRatio;

  /// Max width of canvas
  late double maxWidth;

  /// Max height of canvas
  late double maxHeight;

  TextInputConnection? _textInputConnection;
  RawKeyboardListener? mouseAndGesture;

  void _openInputConnection() {
    var textStyle = TextStyle(fontSize: 14.0);
    print('_openInputConnection');
    _textInputConnection = TextInput.attach(
        this,
        const TextInputConfiguration(
            inputType: TextInputType.multiline,
            inputAction: TextInputAction.none,
            readOnly: false,
            obscureText: false,
            enableDeltaModel: false,
            smartDashesType: SmartDashesType.enabled,
            smartQuotesType: SmartQuotesType.enabled,
            enableInteractiveSelection: false));
    _textInputConnection!
      ..setStyle(
          fontFamily: textStyle.fontFamily,
          fontSize: textStyle.fontSize,
          fontWeight: textStyle.fontWeight,
          textDirection: TextDirection.ltr,
          textAlign: TextAlign.center)
      ..setEditingState(const TextEditingValue(text: ''));

    _textInputConnection?.show();
  }

  void _incrementCounter() {
    if (widget.focusNode!.hasFocus) {
      _openInputConnection();
    } else {
      // widget.focusNode?.requestFocus();
      mouseAndGesture?.focusNode.requestFocus();
    }
  }

  int? activePointerId;
  @override
  Widget build(BuildContext context) {
    final GestureDetector gestureDetector = GestureDetector(
      onVerticalDragUpdate: (DragUpdateDetails details) {
        //NO-OP
      },
      child: Container(
        decoration: BoxDecoration(color: Colors.white),
        child: Listener(
          onPointerDown: (PointerDownEvent event) {
            if (activePointerId == null || activePointerId == event.pointer) {
              final Offset o = event.localPosition;
              activePointerId = event.pointer;
            }
          },
          onPointerUp: (PointerUpEvent event) {
            if (activePointerId == event.pointer) {
              final Offset o = event.localPosition;
            }
          },
          onPointerCancel: (PointerCancelEvent event) {
            if (activePointerId == event.pointer) {}
          },
          onPointerMove: (PointerMoveEvent event) {
            if (activePointerId == event.pointer) {
              final Offset o = event.localPosition;
            }
          },
          onPointerSignal: (pointerSignal) {},
          onPointerHover: (PointerHoverEvent event) {},
          child: Container(
            color: Colors.transparent,
            child: Texture(textureId: 0),
          ),
        ),
      ),
    );
    mouseAndGesture = RawKeyboardListener(
      focusNode: FocusNode(),
      autofocus: false,
      onKey: (event) {},
      child: MouseRegion(
        cursor: MouseCursor.defer,
        onEnter: (PointerEnterEvent event) {
          print('---mouse enter ');
          setState(() {});
        },
        onExit: (PointerExitEvent event) {
          print('---mouse onExit ');
        },
        onHover: (PointerHoverEvent event) {
          final Offset o = event.localPosition;
          // print('---mouse HoverEvent $o ');
        },
        child: gestureDetector,
      ),
    );
    Widget wbp = IgnorePointer(
        ignoring: false, //是否事件穿透
        child: LayoutBuilder(builder: ((context, constraints) {
          _pixelRatio = MediaQuery.of(context).devicePixelRatio;

          maxWidth = constraints.biggest.width;
          maxHeight = constraints.biggest.height;
          if (mouseAndGesture != null) {
            mouseAndGesture?.focusNode.addListener(_openInputConnection);
          }
          return mouseAndGesture ?? gestureDetector;
        })));
    // This method is rerun every time setState is called, for instance as done
    // by the _incrementCounter method above.
    //
    // The Flutter framework has been optimized to make rerunning build methods
    // fast, so that you can just rebuild anything that needs updating rather
    // than having to individually change instances of widgets.
    return Scaffold(
      appBar: AppBar(
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: Text(widget.title),
      ),
      body: Center(
        // Center is a layout widget. It takes a single child and positions it
        // in the middle of the parent.
        child: Column(
          // Column is also a layout widget. It takes a list of children and
          // arranges them vertically. By default, it sizes itself to fit its
          // children horizontally, and tries to be as tall as its parent.
          //
          // Invoke "debug painting" (press "p" in the console, choose the
          // "Toggle Debug Paint" action from the Flutter Inspector in Android
          // Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
          // to see the wireframe for each widget.
          //
          // Column has various properties to control how it sizes itself and
          // how it positions its children. Here we use mainAxisAlignment to
          // center the children vertically; the main axis here is the vertical
          // axis because Columns are vertical (the cross axis would be
          // horizontal).
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Container(
              width: 900,
              height: 540,
              child: wbp,
              color: Colors.blue,
            )
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }

  @override
  void connectionClosed() {
    // TODO: implement connectionClosed
  }

  @override
  // TODO: implement currentAutofillScope
  AutofillScope? get currentAutofillScope => throw UnimplementedError();

  @override
  // TODO: implement currentTextEditingValue
  TextEditingValue? get currentTextEditingValue => throw UnimplementedError();

  @override
  void performAction(TextInputAction action) {
    // TODO: implement performAction
    print('performPrivateCommand $performAction');
  }

  @override
  void performPrivateCommand(String action, Map<String, dynamic> data) {
    // TODO: implement performPrivateCommand
    print('performPrivateCommand $action $data');
  }

  @override
  void showAutocorrectionPromptRect(int start, int end) {
    // TODO: implement showAutocorrectionPromptRect
    print('showAutocorrectionPromptRect $start $end');
  }

  @override
  void updateEditingValue(TextEditingValue value) {
    // TODO: implement updateEditingValue
    print('updateEditingValue $value');
  }

  @override
  void updateFloatingCursor(RawFloatingCursorPoint point) {
    // TODO: implement updateFloatingCursor
    print('updateFloatingCursor $point');
  }
}

```

</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>


### Logs

<details><summary>Logs</summary>

```console
flutter: ---mouse enter
flutter: ---mouse onExit
flutter: _openInputConnection
flutter: ---mouse enter
flutter: ---mouse onExit
flutter: updateEditingValue TextEditingValue(text: ┤├, selection: TextSelection.collapsed(offset: 0, affinity: TextAffinity.downstream, isDirectional: false), composing: TextRange(start: -1, end: -1))
flutter: ---mouse enter
2023-04-17 20:33:01.103 flutter_text_input_test[7111:1986259] TSM AdjustCapsLockLEDForKeyTransitionHandling - _ISSetPhysicalKeyboardCapsLockLED Inhibit
2023-04-17 20:33:01.340 flutter_text_input_test[7111:1986259] _TIPropertyValueIsValid called with 5 on nil context!
2023-04-17 20:33:01.340 flutter_text_input_test[7111:1986259] imkxpc_getApplicationProperty:reply: called with incorrect property value 5, bailing.
2023-04-17 20:33:01.340 flutter_text_input_test[7111:1986259] Text input context does not respond to _valueForTIProperty:
2023-04-17 20:33:01.341 flutter_text_input_test[7111:1986259] _TIPropertyValueIsValid called with 4 on nil context!
2023-04-17 20:33:01.341 flutter_text_input_test[7111:1986259] imkxpc_getApplicationProperty:reply: called with incorrect property value 4, bailing.
2023-04-17 20:33:01.341 flutter_text_input_test[7111:1986259] Text input context does not respond to _valueForTIProperty:
```
</details>


### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.7.5, on macOS 13.2.1 22D68 darwin-x64, locale
    zh-Hans-CN)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor
      --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[!] Android Studio (version 2022.1)
    ✗ Unable to find bundled Java version.
[✓] VS Code (version 1.77.0)
[✓] Connected device (2 available)
[✓] HTTP Host Availability```

</details>