text:
TextPainter.getPositionForOffset returns different values when run on web tests

Is there an existing issue for this?

[X] I have searched the existing issues
[X] I have read the guide to filing a bug

Info
When tests are run on the web TextPainter.getPositionForOffset returns different values for the same given Offset when compared to other platforms.
Steps to Reproduce
Placing the following test in test/rendering/paragraph_test.dart fails when run with flutter test test/rendering/paragraph_test.dart --platform=chrome. This test also passes when using --web-renderer=canvaskit but fails with skwasm and html. This test passes on other platforms when run with flutter test test/rendering/paragraph_test.dart.
  Offset textOffsetToPosition(RenderParagraph paragraph, int offset) {
    const Rect caret = Rect.fromLTWH(0.0, 0.0, 2.0, 20.0);
    final Offset localOffset = paragraph.getOffsetForCaret(TextPosition(offset: offset), caret);
    return paragraph.localToGlobal(localOffset);
  }

  test('getWordBoundary control test failing', () {
    final RenderParagraph paragraph = RenderParagraph(
      const TextSpan(text: 'How are you?'),
      textDirection: TextDirection.ltr,
    );
    layout(paragraph);

    final Offset target4 = textOffsetToPosition(paragraph, 4);
    final TextPosition position4 = paragraph.getPositionForOffset(target4);
    expect(position4, TextPosition(offset: 4));
    final TextRange range4 = paragraph.getWordBoundary(position4);
    expect(range4.textInside('How are you?'), equals('are'));
  });

Expected results
Test passes on all platforms.
Actual results
Test fails on web with skwasm and html renderers.  Returns TextPosition(4, upstream) and other platforms return TextPosition(4, downstream).
Flutter Doctor output
Doctor output
[!] Flutter (Channel unknown, 3.10.0-15.0.pre.34, on macOS 13.3.1 22E261 darwin-arm64, locale en-US)
    ! Flutter version 3.10.0-15.0.pre.34 on channel unknown at /Users/roliv/flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
    ! Unknown upstream repository.
      Reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
    • Framework revision e1844791cf (25 hours ago), 2023-04-25 12:23:16 -0700
    • Engine revision 40187bb9af
    • Dart version 3.1.0 (build 3.1.0-47.0.dev)
    • DevTools version 2.23.1
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at /Users/roliv/Library/Android/sdk
    • Platform android-33, build-tools 33.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    • 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.12.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.1)
    • 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 11.0.15+0-b2043.56-8887301)

[✓] VS Code (version 1.77.3)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.62.0

[✓] Connected device (4 available)
    • sdk gphone64 arm64 (mobile) • emulator-5554                        • android-arm64  • Android 13 (API 33) (emulator)
    • iPhone 14 Pro Max (mobile)  • E36EA4AD-49FE-4C28-9E6D-DECB4487BD46 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-2 (simulator)
    • macOS (desktop)             • macos                                • darwin-arm64   • macOS 13.3.1 22E261 darwin-arm64
    • Chrome (web)                • chrome                               • web-javascript • Google Chrome 112.0.5615.137

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

Reproducible using the test sample and steps outlined above.

logs

### Canvaskit
nexus@Daniels-MBP flutter % flutter test test/rendering/paragraph_test.dart --platform=chrome --web-renderer=canvaskit
00:03 +29 ~8: All tests passed!

### HTML renderer
nexus@Daniels-MBP flutter % flutter test test/rendering/paragraph_test.dart --platform=chrome --web-renderer=html
00:02 +9 ~7 -1: getWordBoundary control test failing [E]
  Expected: TextPosition:<TextPosition(offset: 4, affinity: TextAffinity.downstream)>
    Actual: TextPosition:<TextPosition(offset: 4, affinity: TextAffinity.upstream)>

  ../dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 288:49      throw_
  ../packages/matcher/src/expect/prints_matcher.dart.js 454:22                         fail
  ../packages/matcher/src/expect/prints_matcher.dart.js 451:12                         _expect
  ../packages/matcher/src/expect/prints_matcher.dart.js 386:12                         expect$
  ../packages/flutter_test/src/test_text_input_key_handler.dart.js 7541:12             expect$
  paragraph_test.dart.js 3248:21                                                       <fn>
  ../packages/test_api/src/backend/declarer.dart.js 257:56                             <fn>
  ../dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50                <fn>
  ../packages/stack_trace/src/stack_zone_specification.dart.js 184:98                  <fn>
  ../packages/stack_trace/src/stack_zone_specification.dart.js 236:16                  [_run]
  ../packages/stack_trace/src/stack_zone_specification.dart.js 184:80                  <fn>
  ../dart-sdk/lib/async/zone.dart 1407:47                                              _rootRunUnary
  ../dart-sdk/lib/async/zone.dart 1308:19                                              runUnary
  ../dart-sdk/lib/async/future_impl.dart 147:18                                        handleValue
  ../dart-sdk/lib/async/future_impl.dart 784:44                                        handleValueCallback
  ../dart-sdk/lib/async/future_impl.dart 813:13                                        _propagateToListeners
  ../dart-sdk/lib/async/future_impl.dart 448:9                                         <fn>
  ../packages/stack_trace/src/stack_zone_specification.dart.js 236:16                  [_run]
  ../packages/stack_trace/src/stack_zone_specification.dart.js 179:71                  <fn>
  ../dart-sdk/lib/async/zone.dart 1399:13                                              _rootRun
  ../dart-sdk/lib/async/zone.dart 1301:19                                              run
  ../dart-sdk/lib/async/zone.dart 1209:7                                               runGuarded
  ../dart-sdk/lib/async/zone.dart 1249:23                                              callback
  ../dart-sdk/lib/async/schedule_microtask.dart 40:11                                  _microtaskLoop
  ../dart-sdk/lib/async/schedule_microtask.dart 49:5                                   _startMicrotaskLoop
  ../dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 177:15               <fn>
  ===== asynchronous gap ===========================
  ../dart-sdk/lib/async/zone.dart 1329:19                                              registerUnaryCallback
  ../dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 67:19                _async
  ../packages/test_api/src/backend/declarer.dart.js 255:69                             <fn>
  ../dart-sdk/lib/async/zone.dart 1399:13                                              _rootRun
  ../dart-sdk/lib/async/zone.dart 1301:19                                              run
  ../dart-sdk/lib/async/zone.dart 1803:67                                              _runZoned
  ../dart-sdk/lib/async/zone.dart 1747:10                                              runZoned
  ../packages/test_api/src/backend/declarer.dart.js 255:21                             <fn>
  ../dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54                runBody
  ../dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5                _async
  ../packages/test_api/src/backend/declarer.dart.js 245:90                             <fn>
  ../packages/test_api/src/backend/declarer.dart.js 661:61                             <fn>
  ../dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54                runBody
  ../dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5                _async
  ../packages/test_api/src/backend/declarer.dart.js 657:61                             <fn>
  ../dart-sdk/lib/async/zone.dart 1399:13                                              _rootRun
  ../dart-sdk/lib/async/zone.dart 1301:19                                              run
  ../dart-sdk/lib/async/zone.dart 1803:67                                              _runZoned
  ../dart-sdk/lib/async/zone.dart 1747:10                                              runZoned
  ../packages/test_api/src/backend/declarer.dart.js 657:13                             [_waitForOutstandingCallbacks]
  ../packages/test_api/src/backend/declarer.dart.js 740:53                             <fn>
  ../dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50                <fn>
  ../packages/stack_trace/src/stack_zone_specification.dart.js 184:98                  <fn>
  ../packages/stack_trace/src/stack_zone_specification.dart.js 236:16                  [_run]
  ../packages/stack_trace/src/stack_zone_specification.dart.js 184:80                  <fn>
  ../dart-sdk/lib/async/zone.dart 1407:47                                              _rootRunUnary
  ../dart-sdk/lib/async/zone.dart 1308:19                                              runUnary
  ../dart-sdk/lib/async/future_impl.dart 147:18                                        handleValue
  ../dart-sdk/lib/async/future_impl.dart 784:44                                        handleValueCallback
  ../dart-sdk/lib/async/future_impl.dart 813:13                                        _propagateToListeners
  ../dart-sdk/lib/async/future_impl.dart 575:7                                         [_complete]
  ../dart-sdk/lib/async/future.dart 256:15                                             <fn>
  ../packages/stack_trace/src/stack_zone_specification.dart.js 236:16                  [_run]
  ../packages/stack_trace/src/stack_zone_specification.dart.js 179:71                  <fn>
  ../dart-sdk/lib/async/zone.dart 1391:47                                              _rootRun
  ../dart-sdk/lib/async/zone.dart 1301:19                                              run
  ../dart-sdk/lib/async/zone.dart 1209:7                                               runGuarded
  ../dart-sdk/lib/async/zone.dart 1249:23                                              <fn>
  ../packages/stack_trace/src/stack_zone_specification.dart.js 236:16                  [_run]
  ../packages/stack_trace/src/stack_zone_specification.dart.js 179:71                  <fn>
  ../dart-sdk/lib/async/zone.dart 1399:13                                              _rootRun
  ../dart-sdk/lib/async/zone.dart 1301:19                                              run
  ../dart-sdk/lib/async/zone.dart 1233:23                                              <fn>
  ../dart-sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart 48:19           internalCallback
  ===== asynchronous gap ===========================
  ../dart-sdk/lib/async/zone.dart 1329:19                                              registerUnaryCallback
  ../dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 67:19                _async
  ../packages/test_api/src/backend/declarer.dart.js 737:65                             <fn>
  ../dart-sdk/lib/async/zone.dart 1399:13                                              _rootRun
  ../dart-sdk/lib/async/zone.dart 1301:19                                              run
  ../dart-sdk/lib/async/zone.dart 1803:67                                              _runZoned
  ../dart-sdk/lib/async/zone.dart 1747:10                                              runZoned
  ../packages/test_api/src/backend/declarer.dart.js 737:17                             <fn>
  ../packages/test_api/src/backend/declarer.dart.js 758:9                              [_guardIfGuarded]
  ../packages/test_api/src/backend/declarer.dart.js 736:30                             <fn>
  ../packages/stack_trace/src/stack_zone_specification.dart.js 1118:18                 <fn>
  ../dart-sdk/lib/async/zone.dart 1399:13                                              _rootRun
  ../dart-sdk/lib/async/zone.dart 1301:19                                              run
  ../dart-sdk/lib/async/zone.dart 1803:67                                              _runZoned
  ../dart-sdk/lib/async/zone.dart 1747:10                                              runZoned
  ../packages/stack_trace/src/stack_zone_specification.dart.js 1116:20                 capture
  ../packages/test_api/src/backend/declarer.dart.js 735:19                             [_onRun]
  ../packages/test_api/src/backend/live_test_controller.dart.js 157:20                 run
  ../packages/test_api/src/backend/remote_listener.dart.js 210:18                      <fn>
  ../dart-sdk/lib/async/zone.dart 1399:13                                              _rootRun
  ../dart-sdk/lib/async/zone.dart 1301:19                                              run
  ../dart-sdk/lib/async/zone.dart 1803:67                                              _runZoned
  ../dart-sdk/lib/async/zone.dart 1747:10                                              runZoned
  ../packages/test_api/src/backend/remote_listener.dart.js 209:13                      [_runLiveTest]
  ../packages/test_api/src/backend/remote_listener.dart.js 190:27                      <fn>
  ../dart-sdk/lib/async/zone.dart 1407:47                                              _rootRunUnary
  ../dart-sdk/lib/async/zone.dart 1308:19                                              runUnary
  ../dart-sdk/lib/async/zone.dart 1217:7                                               runUnaryGuarded
  ../dart-sdk/lib/async/stream_impl.dart 339:11                                        [_sendData]
  ../dart-sdk/lib/async/stream_impl.dart 271:7                                         [_add]
  ../dart-sdk/lib/async/stream_controller.dart 776:19                                  [_sendData]
  ../dart-sdk/lib/async/stream_controller.dart 650:7                                   [_add]
  ../dart-sdk/lib/async/stream_controller.dart 598:5                                   add
  ../dart-sdk/lib/async/zone.dart 1415:13                                              _rootRunUnary
  ../dart-sdk/lib/async/zone.dart 1308:19                                              runUnary
  ../dart-sdk/lib/async/zone.dart 1217:7                                               runUnaryGuarded
  ../dart-sdk/lib/async/stream_impl.dart 339:11                                        [_sendData]
  ../dart-sdk/lib/async/stream_impl.dart 271:7                                         [_add]
  ../dart-sdk/lib/async/stream_controller.dart 776:19                                  [_sendData]
  ../dart-sdk/lib/async/stream_controller.dart 650:7                                   [_add]
  ../dart-sdk/lib/async/stream_controller.dart 598:5                                   add
  ../dart-sdk/lib/async/stream_controller.dart 868:13                                  add
  ../packages/stream_channel/src/stream_channel_controller.dart.js 1177:24             add
  ../packages/stream_channel/src/stream_channel_controller.dart.js 458:33              <fn>
  ../dart-sdk/lib/async/zone.dart 1594:10                                              runUnaryGuarded
  ../dart-sdk/lib/internal/async_cast.dart 85:11                                       [_onData]
  ../dart-sdk/lib/async/zone.dart 1594:10                                              runUnaryGuarded
  ../dart-sdk/lib/async/stream_impl.dart 339:11                                        [_sendData]
  ../dart-sdk/lib/async/stream_impl.dart 271:7                                         [_add]
  ../dart-sdk/lib/async/stream_controller.dart 776:19                                  [_sendData]
  ../dart-sdk/lib/async/stream_controller.dart 650:7                                   [_add]
  ../dart-sdk/lib/async/stream_controller.dart 598:5                                   add
  ../dart-sdk/lib/async/zone.dart 1594:10                                              runUnaryGuarded
  ../dart-sdk/lib/async/stream_impl.dart 339:11                                        [_sendData]
  ../dart-sdk/lib/async/stream_impl.dart 271:7                                         [_add]
  ../dart-sdk/lib/async/stream_controller.dart 776:19                                  [_sendData]
  ../dart-sdk/lib/async/stream_controller.dart 650:7                                   [_add]
  ../dart-sdk/lib/async/stream_controller.dart 598:5                                   add
  ../dart-sdk/lib/async/stream_controller.dart 868:13                                  add
  ../dart-sdk/lib/async/zone.dart 1594:10                                              runUnaryGuarded
  ../dart-sdk/lib/async/stream_impl.dart 339:11                                        [_sendData]
  ../dart-sdk/lib/async/stream_impl.dart 271:7                                         [_add]
  ../dart-sdk/lib/async/stream_controller.dart 776:19                                  [_sendData]
  ../dart-sdk/lib/async/stream_controller.dart 650:7                                   [_add]
  ../dart-sdk/lib/async/stream_controller.dart 598:5                                   add
  ../dart-sdk/lib/async/zone.dart 1594:10                                              runUnaryGuarded
  ../dart-sdk/lib/async/stream_impl.dart 339:11                                        [_sendData]
  ../dart-sdk/lib/async/stream_impl.dart 271:7                                         [_add]
  ../dart-sdk/lib/async/stream_controller.dart 776:19                                  [_sendData]
  ../dart-sdk/lib/async/stream_controller.dart 650:7                                   [_add]
  ../dart-sdk/lib/async/stream_controller.dart 598:5                                   add
  ../dart-sdk/lib/async/stream_controller.dart 868:13                                  add
  ../packages/stream_channel/src/stream_channel_controller.dart.js 1177:24             add
  ../rendering_paragraph_test.dart.test.dart.js 88:31                                  <fn>
  ../dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 367:37  _checkAndCall
  ../dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 372:39  dcall
  ../dart-sdk/lib/html/dart2js/html_dart2js.dart 37236:58                              <fn>

To run this test again: /Users/nexus/dev/sdks/flutters/bin/cache/dart-sdk/bin/dart test test/rendering/paragraph_test.dart -p chrome --plain-name 'getWordBoundary control test failing'
00:02 +27 ~9 -1: Some tests failed.

### wasm
nexus@Daniels-MBP flutter % flutter test test/rendering/paragraph_test.dart --platform=chrome --web-renderer=skwasm
00:02 +9 ~7 -1: getWordBoundary control test failing [E]
  Expected: TextPosition:<TextPosition(offset: 4, affinity: TextAffinity.downstream)>
    Actual: TextPosition:<TextPosition(offset: 4, affinity: TextAffinity.upstream)>

  ../dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 288:49      throw_
  ../packages/matcher/src/expect/prints_matcher.dart.js 454:22                         fail
  ../packages/matcher/src/expect/prints_matcher.dart.js 451:12                         _expect
  ../packages/matcher/src/expect/prints_matcher.dart.js 386:12                         expect$
  ../packages/flutter_test/src/test_text_input_key_handler.dart.js 7541:12             expect$
  paragraph_test.dart.js 3248:21                                                       <fn>
  ../packages/test_api/src/backend/declarer.dart.js 257:56                             <fn>
  ../dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50                <fn>
  ../packages/stack_trace/src/stack_zone_specification.dart.js 184:98                  <fn>
  ../packages/stack_trace/src/stack_zone_specification.dart.js 236:16                  [_run]
  ../packages/stack_trace/src/stack_zone_specification.dart.js 184:80                  <fn>
  ../dart-sdk/lib/async/zone.dart 1407:47                                              _rootRunUnary
  ../dart-sdk/lib/async/zone.dart 1308:19                                              runUnary
  ../dart-sdk/lib/async/future_impl.dart 147:18                                        handleValue
  ../dart-sdk/lib/async/future_impl.dart 784:44                                        handleValueCallback
  ../dart-sdk/lib/async/future_impl.dart 813:13                                        _propagateToListeners
  ../dart-sdk/lib/async/future_impl.dart 448:9                                         <fn>
  ../packages/stack_trace/src/stack_zone_specification.dart.js 236:16                  [_run]
  ../packages/stack_trace/src/stack_zone_specification.dart.js 179:71                  <fn>
  ../dart-sdk/lib/async/zone.dart 1399:13                                              _rootRun
  ../dart-sdk/lib/async/zone.dart 1301:19                                              run
  ../dart-sdk/lib/async/zone.dart 1209:7                                               runGuarded
  ../dart-sdk/lib/async/zone.dart 1249:23                                              callback
  ../dart-sdk/lib/async/schedule_microtask.dart 40:11                                  _microtaskLoop
  ../dart-sdk/lib/async/schedule_microtask.dart 49:5                                   _startMicrotaskLoop
  ../dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 177:15               <fn>
  ===== asynchronous gap ===========================
  ../dart-sdk/lib/async/zone.dart 1329:19                                              registerUnaryCallback
  ../dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 67:19                _async
  ../packages/test_api/src/backend/declarer.dart.js 255:69                             <fn>
  ../dart-sdk/lib/async/zone.dart 1399:13                                              _rootRun
  ../dart-sdk/lib/async/zone.dart 1301:19                                              run
  ../dart-sdk/lib/async/zone.dart 1803:67                                              _runZoned
  ../dart-sdk/lib/async/zone.dart 1747:10                                              runZoned
  ../packages/test_api/src/backend/declarer.dart.js 255:21                             <fn>
  ../dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54                runBody
  ../dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5                _async
  ../packages/test_api/src/backend/declarer.dart.js 245:90                             <fn>
  ../packages/test_api/src/backend/declarer.dart.js 661:61                             <fn>
  ../dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54                runBody
  ../dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5                _async
  ../packages/test_api/src/backend/declarer.dart.js 657:61                             <fn>
  ../dart-sdk/lib/async/zone.dart 1399:13                                              _rootRun
  ../dart-sdk/lib/async/zone.dart 1301:19                                              run
  ../dart-sdk/lib/async/zone.dart 1803:67                                              _runZoned
  ../dart-sdk/lib/async/zone.dart 1747:10                                              runZoned
  ../packages/test_api/src/backend/declarer.dart.js 657:13                             [_waitForOutstandingCallbacks]
  ../packages/test_api/src/backend/declarer.dart.js 740:53                             <fn>
  ../dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50                <fn>
  ../packages/stack_trace/src/stack_zone_specification.dart.js 184:98                  <fn>
  ../packages/stack_trace/src/stack_zone_specification.dart.js 236:16                  [_run]
  ../packages/stack_trace/src/stack_zone_specification.dart.js 184:80                  <fn>
  ../dart-sdk/lib/async/zone.dart 1407:47                                              _rootRunUnary
  ../dart-sdk/lib/async/zone.dart 1308:19                                              runUnary
  ../dart-sdk/lib/async/future_impl.dart 147:18                                        handleValue
  ../dart-sdk/lib/async/future_impl.dart 784:44                                        handleValueCallback
  ../dart-sdk/lib/async/future_impl.dart 813:13                                        _propagateToListeners
  ../dart-sdk/lib/async/future_impl.dart 575:7                                         [_complete]
  ../dart-sdk/lib/async/future.dart 256:15                                             <fn>
  ../packages/stack_trace/src/stack_zone_specification.dart.js 236:16                  [_run]
  ../packages/stack_trace/src/stack_zone_specification.dart.js 179:71                  <fn>
  ../dart-sdk/lib/async/zone.dart 1391:47                                              _rootRun
  ../dart-sdk/lib/async/zone.dart 1301:19                                              run
  ../dart-sdk/lib/async/zone.dart 1209:7                                               runGuarded
  ../dart-sdk/lib/async/zone.dart 1249:23                                              <fn>
  ../packages/stack_trace/src/stack_zone_specification.dart.js 236:16                  [_run]
  ../packages/stack_trace/src/stack_zone_specification.dart.js 179:71                  <fn>
  ../dart-sdk/lib/async/zone.dart 1399:13                                              _rootRun
  ../dart-sdk/lib/async/zone.dart 1301:19                                              run
  ../dart-sdk/lib/async/zone.dart 1233:23                                              <fn>
  ../dart-sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart 48:19           internalCallback
  ===== asynchronous gap ===========================
  ../dart-sdk/lib/async/zone.dart 1329:19                                              registerUnaryCallback
  ../dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 67:19                _async
  ../packages/test_api/src/backend/declarer.dart.js 737:65                             <fn>
  ../dart-sdk/lib/async/zone.dart 1399:13                                              _rootRun
  ../dart-sdk/lib/async/zone.dart 1301:19                                              run
  ../dart-sdk/lib/async/zone.dart 1803:67                                              _runZoned
  ../dart-sdk/lib/async/zone.dart 1747:10                                              runZoned
  ../packages/test_api/src/backend/declarer.dart.js 737:17                             <fn>
  ../packages/test_api/src/backend/declarer.dart.js 758:9                              [_guardIfGuarded]
  ../packages/test_api/src/backend/declarer.dart.js 736:30                             <fn>
  ../packages/stack_trace/src/stack_zone_specification.dart.js 1118:18                 <fn>
  ../dart-sdk/lib/async/zone.dart 1399:13                                              _rootRun
  ../dart-sdk/lib/async/zone.dart 1301:19                                              run
  ../dart-sdk/lib/async/zone.dart 1803:67                                              _runZoned
  ../dart-sdk/lib/async/zone.dart 1747:10                                              runZoned
  ../packages/stack_trace/src/stack_zone_specification.dart.js 1116:20                 capture
  ../packages/test_api/src/backend/declarer.dart.js 735:19                             [_onRun]
  ../packages/test_api/src/backend/live_test_controller.dart.js 157:20                 run
  ../packages/test_api/src/backend/remote_listener.dart.js 210:18                      <fn>
  ../dart-sdk/lib/async/zone.dart 1399:13                                              _rootRun
  ../dart-sdk/lib/async/zone.dart 1301:19                                              run
  ../dart-sdk/lib/async/zone.dart 1803:67                                              _runZoned
  ../dart-sdk/lib/async/zone.dart 1747:10                                              runZoned
  ../packages/test_api/src/backend/remote_listener.dart.js 209:13                      [_runLiveTest]
  ../packages/test_api/src/backend/remote_listener.dart.js 190:27                      <fn>
  ../dart-sdk/lib/async/zone.dart 1407:47                                              _rootRunUnary
  ../dart-sdk/lib/async/zone.dart 1308:19                                              runUnary
  ../dart-sdk/lib/async/zone.dart 1217:7                                               runUnaryGuarded
  ../dart-sdk/lib/async/stream_impl.dart 339:11                                        [_sendData]
  ../dart-sdk/lib/async/stream_impl.dart 271:7                                         [_add]
  ../dart-sdk/lib/async/stream_controller.dart 776:19                                  [_sendData]
  ../dart-sdk/lib/async/stream_controller.dart 650:7                                   [_add]
  ../dart-sdk/lib/async/stream_controller.dart 598:5                                   add
  ../dart-sdk/lib/async/zone.dart 1415:13                                              _rootRunUnary
  ../dart-sdk/lib/async/zone.dart 1308:19                                              runUnary
  ../dart-sdk/lib/async/zone.dart 1217:7                                               runUnaryGuarded
  ../dart-sdk/lib/async/stream_impl.dart 339:11                                        [_sendData]
  ../dart-sdk/lib/async/stream_impl.dart 271:7                                         [_add]
  ../dart-sdk/lib/async/stream_controller.dart 776:19                                  [_sendData]
  ../dart-sdk/lib/async/stream_controller.dart 650:7                                   [_add]
  ../dart-sdk/lib/async/stream_controller.dart 598:5                                   add
  ../dart-sdk/lib/async/stream_controller.dart 868:13                                  add
  ../packages/stream_channel/src/stream_channel_controller.dart.js 1177:24             add
  ../packages/stream_channel/src/stream_channel_controller.dart.js 458:33              <fn>
  ../dart-sdk/lib/async/zone.dart 1594:10                                              runUnaryGuarded
  ../dart-sdk/lib/internal/async_cast.dart 85:11                                       [_onData]
  ../dart-sdk/lib/async/zone.dart 1594:10                                              runUnaryGuarded
  ../dart-sdk/lib/async/stream_impl.dart 339:11                                        [_sendData]
  ../dart-sdk/lib/async/stream_impl.dart 271:7                                         [_add]
  ../dart-sdk/lib/async/stream_controller.dart 776:19                                  [_sendData]
  ../dart-sdk/lib/async/stream_controller.dart 650:7                                   [_add]
  ../dart-sdk/lib/async/stream_controller.dart 598:5                                   add
  ../dart-sdk/lib/async/zone.dart 1594:10                                              runUnaryGuarded
  ../dart-sdk/lib/async/stream_impl.dart 339:11                                        [_sendData]
  ../dart-sdk/lib/async/stream_impl.dart 271:7                                         [_add]
  ../dart-sdk/lib/async/stream_controller.dart 776:19                                  [_sendData]
  ../dart-sdk/lib/async/stream_controller.dart 650:7                                   [_add]
  ../dart-sdk/lib/async/stream_controller.dart 598:5                                   add
  ../dart-sdk/lib/async/stream_controller.dart 868:13                                  add
  ../dart-sdk/lib/async/zone.dart 1594:10                                              runUnaryGuarded
  ../dart-sdk/lib/async/stream_impl.dart 339:11                                        [_sendData]
  ../dart-sdk/lib/async/stream_impl.dart 271:7                                         [_add]
  ../dart-sdk/lib/async/stream_controller.dart 776:19                                  [_sendData]
  ../dart-sdk/lib/async/stream_controller.dart 650:7                                   [_add]
  ../dart-sdk/lib/async/stream_controller.dart 598:5                                   add
  ../dart-sdk/lib/async/zone.dart 1594:10                                              runUnaryGuarded
  ../dart-sdk/lib/async/stream_impl.dart 339:11                                        [_sendData]
  ../dart-sdk/lib/async/stream_impl.dart 271:7                                         [_add]
  ../dart-sdk/lib/async/stream_controller.dart 776:19                                  [_sendData]
  ../dart-sdk/lib/async/stream_controller.dart 650:7                                   [_add]
  ../dart-sdk/lib/async/stream_controller.dart 598:5                                   add
  ../dart-sdk/lib/async/stream_controller.dart 868:13                                  add
  ../packages/stream_channel/src/stream_channel_controller.dart.js 1177:24             add
  ../rendering_paragraph_test.dart.test.dart.js 88:31                                  <fn>
  ../dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 367:37  _checkAndCall
  ../dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 372:39  dcall
  ../dart-sdk/lib/html/dart2js/html_dart2js.dart 37236:58                              <fn>

To run this test again: /Users/nexus/dev/sdks/flutters/bin/cache/dart-sdk/bin/dart test test/rendering/paragraph_test.dart -p chrome --plain-name 'getWordBoundary control test failing'
00:02 +27 ~9 -1: Some tests failed.

flutter doctor -v
[✓] Flutter (Channel stable, 3.7.12, on macOS 13.3.1 22E261 darwin-arm64, locale en-GB)
    • Flutter version 3.7.12 on channel stable at /Users/nexus/dev/sdks/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4d9e56e694 (9 days ago), 2023-04-17 21:47:46 -0400
    • Engine revision 1a65d409c7
    • Dart version 2.19.6
    • DevTools version 2.20.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/222.4459.24.2221.9862592/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.3)
    • Xcode at /Applications/Xcode-14.3.0.app/Contents/Developer
    • Build 14E222b
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.1)
    • Android Studio at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/221.6008.13.2211.9619390/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 11.0.15+0-b2043.56-8887301)

[✓] Android Studio (version 2022.2)
    • Android Studio at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/222.4459.24.2221.9862592/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)

[✓] IntelliJ IDEA Ultimate Edition (version 2023.1)
    • IntelliJ at /Users/nexus/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
    • Flutter plugin version 73.0.4
    • Dart plugin version 231.8109.91

[✓] IntelliJ IDEA Ultimate Edition (version 2023.1)
    • IntelliJ at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/231.8109.175/IntelliJ IDEA.app
    • 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

[✓] VS Code (version 1.77.3)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.62.0

[✓] Connected device (3 available)
    • Pixel 7 (mobile) • 28291FDH2001SA • android-arm64  • Android 13 (API 33)
    • macOS (desktop)  • macos          • darwin-arm64   • macOS 13.3.1 22E261 darwin-arm64
    • Chrome (web)     • chrome         • web-javascript • Google Chrome 112.0.5615.137

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

[!] Flutter (Channel master, 3.10.0-15.0.pre.23, on macOS 13.3.1 22E261 darwin-arm64, locale en-GB)
    • Flutter version 3.10.0-15.0.pre.23 on channel master at /Users/nexus/dev/sdks/flutters
    ! Warning: `flutter` on your path resolves to /Users/nexus/dev/sdks/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/nexus/dev/sdks/flutters. Consider adding /Users/nexus/dev/sdks/flutters/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/nexus/dev/sdks/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/nexus/dev/sdks/flutters. Consider adding /Users/nexus/dev/sdks/flutters/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 1459633486 (75 minutes ago), 2023-04-27 01:35:24 -0400
    • Engine revision 99b7fc1aa5
    • Dart version 3.1.0 (build 3.1.0-48.0.dev)
    • DevTools version 2.23.1
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/222.4459.24.2221.9862592/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.3)
    • Xcode at /Applications/Xcode-14.3.0.app/Contents/Developer
    • Build 14E222b
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.1)
    • Android Studio at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/221.6008.13.2211.9619390/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 11.0.15+0-b2043.56-8887301)

[✓] Android Studio (version 2022.2)
    • Android Studio at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/222.4459.24.2221.9862592/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)

[✓] IntelliJ IDEA Ultimate Edition (version 2023.1)
    • IntelliJ at /Users/nexus/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
    • Flutter plugin version 73.0.4
    • Dart plugin version 231.8109.91

[✓] IntelliJ IDEA Ultimate Edition (version 2023.1)
    • IntelliJ at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/231.8109.175/IntelliJ IDEA.app
    • 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

[✓] VS Code (version 1.77.3)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.62.0

[✓] Connected device (4 available)
    • Pixel 7 (mobile) • 28291FDH2001SA            • android-arm64  • Android 13 (API 33)
    • Nexus (mobile)   • 00008020-001875E83A38002E • ios            • iOS 16.4.1 20E252
    • macOS (desktop)  • macos                     • darwin-arm64   • macOS 13.3.1 22E261 darwin-arm64
    • Chrome (web)     • chrome                    • web-javascript • Google Chrome 112.0.5615.137

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

authors: Renzo-Olivares danagbemava-nc


text:
[tool_crash] FileSystemException: Cannot open file, OS Error: 系统找不到指定的文件。, errno = 2

Command
flutter create .\flutter_projects\ --template app --overwrite --project-name demo1

Steps to Reproduce

...
...
...

Logs
FileSystemException: Cannot open file, OS Error: 系统找不到指定的文件。
, errno = 2
#0      _File.throwIfError (dart:io/file_impl.dart:629:7)
#1      _File.openSync (dart:io/file_impl.dart:473:5)
#2      _File.readAsBytesSync (dart:io/file_impl.dart:533:18)
#3      _File.readAsStringSync (dart:io/file_impl.dart:578:18)
#4      ForwardingFile.readAsStringSync (package:file/src/forwarding/forwarding_file.dart:99:16)
#5      ErrorHandlingFile.readAsStringSync.<anonymous closure> (package:flutter_tools/src/base/error_handling_io.dart:222:22)
#6      _runSync (package:flutter_tools/src/base/error_handling_io.dart:600:14)
#7      ErrorHandlingFile.readAsStringSync (package:flutter_tools/src/base/error_handling_io.dart:221:12)
#8      CreateBase._computeTemplateManifest (package:flutter_tools/src/commands/create_base.dart:674:37)
#9      CreateBase._templateManifest (package:flutter_tools/src/commands/create_base.dart:661:43)
#10     CreateBase._templateManifest (package:flutter_tools/src/commands/create_base.dart)
#11     CreateBase.renderMerged (package:flutter_tools/src/commands/create_base.dart:487:25)
#12     CreateBase.generateApp (package:flutter_tools/src/commands/create_base.dart:512:29)
#13     CreateCommand.runCommand (package:flutter_tools/src/commands/create.dart:351:37)
<asynchronous suspension>
#14     FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1257:27)
<asynchronous suspension>
#15     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#16     CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#17     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:283:9)
<asynchronous suspension>
#18     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>

[✓] Flutter (Channel stable, 3.7.12, on Microsoft Windows [Version 10.0.19045.2846], locale en-US)
    • Flutter version 3.7.12 on channel stable at D:\Software\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4d9e56e694 (2 weeks ago), 2023-04-17 21:47:46 -0400
    • Engine revision 1a65d409c7
    • Dart version 2.19.6
    • DevTools version 2.20.1

[✓] Windows Version (Installed version of Windows is version 10 or higher)

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at C:\Users\danie\AppData\Local\Android\sdk
    • Platform android-33, build-tools 33.0.2
    • ANDROID_HOME = C:\Users\danie\AppData\Local\Android
    • Java binary at: D:\Software\AndroidStudio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[✓] Visual Studio - develop for Windows (Visual Studio Community 2022 17.5.5)
    • Visual Studio at D:\Software\VisualStudio
    • Visual Studio Community 2022 version 17.5.33627.172
    • Windows 10 SDK version 10.0.22000.0

[✓] Android Studio (version 2022.2)
    • Android Studio at D:\Software\AndroidStudio
    • 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-b2043.56-9586694)

[✓] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19045.2846]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 112.0.5615.138
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 87.0.664.66

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

Flutter Application Metadata
No pubspec in working directory.

abandoned

source: gharchive/issue

repo: flutter/flutter

license_type: permissive

license_source: github-api


text:
Text widget is rendered pixelated on iPhone XR when wrapped with Opacity widget

Steps to reproduce
Text widget is rendered pixelated on iPhone XR when using SF Pro text font with -0.5 letterSpacing and Opacity widget.
See code sample below.
Expected results
Text widget should be rendered normally when wrapped with Opacity widget.
Actual results
Text widget is rendered pixelated when wrapped with Opacity widget.
Code sample
Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) => const MaterialApp(home: HomePage());
}

class HomePage extends StatelessWidget {
  const HomePage({super.key});

  static const _textStyle = TextStyle(
    fontFamily: "SFProText", // <<<<<<<< custom font
    fontSize: 24,
    fontWeight: FontWeight.w400,
    letterSpacing: -0.5, // <<<<<<<< custom letter spacing
  );

  @override
  Widget build(BuildContext context) => const Scaffold(
        body: Center(
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              Opacity(
                opacity: 0.5,
                child: Text("Pixelated text", style: _textStyle),
              ),
              Text("Normal text", style: _textStyle),
            ],
          ),
        ),
      );
}

Screenshots or Video

Screenshots

Logs
No response
Flutter Doctor output
Doctor output

[✓] Flutter (Channel stable, 3.10.0, on macOS 13.2.1 22D68 darwin-x64, locale en-IL)
    • Flutter version 3.10.0 on channel stable at /Users/xxx/fvm/versions/3.10.0
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 84a1e904f4 (2 weeks ago), 2023-05-09 07:41:44 -0700
    • Engine revision d44b5a94c9
    • Dart version 3.0.0
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/xxx/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • ANDROID_HOME = /Users/xxx/Library/Android/sdk
    • 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.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E222b
    • CocoaPods version 1.12.1

[✓] 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.78.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.64.0

[✓] Connected device (3 available)
    • iPhone XR (mobile) • 00008020-000931213CFA002E • ios            • iOS 15.7.1 19H117
    • macOS (desktop)    • macos                     • darwin-x64     • macOS 13.2.1 22D68 darwin-x64
    • Chrome (web)       • chrome                    • web-javascript • Google Chrome 113.0.5672.126

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Hi @talp-flytrex, please share the font file that you used in your reproduction.
Thank you

Hi @talp-flytrex, can you try running the app with the command below to see if it reproduces for you? Before that, can you try to upgrade to stable 3.10.1 to see if it reproduces? If it does, can you try running the command below?
flutter run --no-enable-impeller.
On flutter 3.10+, the default renderer for iOS is impeller. I tested this on my iPhone XS but I could not reproduce the bug and I do not have an iPhone XR so I cannot test on that device as well.

@danagbemava-nc
Issue still happens with 3.10.1
Issue does NOT happen when running flutter run --no-enable-impeller.
I also tested on several iOS devices and it happens only on iPhone XR.

Hi @talp-flytrex, thanks for the updates. One final thing, can you check on the master channel to see if you still experience the issue over there?
You can switch to the master channel by running
flutter channel master
flutter upgrade

If it still reproduces on the master channel, please provide the output of flutter doctor -v for the master channel and if possible some side-by-side screenshots of skia vs impeller.
Thank you

@danagbemava-nc
The issue still happens on master channel (version: 3.11.0-14.0.pre.61)

Thanks for the info @talp-flytrex.
Labeling for further investigation as this seems to reproduce only on specific devices as reported in https://github.com/flutter/flutter/issues/127386#issuecomment-1560611674.
This seems to be an impeller only issue as well.

I have the same issue using flutter 3.10.3 & several iphone devices. (iphone 14 pro max, iphone 11)

I had this issue too, I will use Skia until this issue is solved

The screenshots provided (of the text) also happens for me on the iPhoneXR. I like Impeller way more in general but the text rendering is still way better with Skia unfortunately

Hi, coming from https://github.com/dnfield/flutter_svg/issues/975
Not to rush or anything but, since impeller is being used by default in the latest Flutter, this rendering problem causes a lot of bad feedback for our app (when using svg icons)
I personally did not see any weird text rendering tbh.
Respectfully, is there any ETA on this?

Is this supposed to reproduce on the iPhone XR simulator?  It looks fine there at HEAD:
doctor
$ flutter doctor -v
[✓] Flutter (Channel main, 3.16.0-11.0.pre.82, on macOS 13.6 22G120 darwin-arm64, locale en)
    • Flutter version 3.16.0-11.0.pre.82 on channel main at /Users/aaclarke/dev/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 06c1b1ecf4 (2 hours ago), 2023-10-16 14:29:19 -0400
    • Engine revision 64734a2666
    • Dart version 3.3.0 (build 3.3.0-27.0.dev)
    • DevTools version 2.28.1

screenshot

I just checked out framework version 84a1e904f4 (3.10), and this definitely reproduces there on the simulator.  I'm marking this as closed since it doesn't reproduce at HEAD anymore.

(Screenshot at 84a1e904f4 with iPhone XR simulator)

authors: FelixMittermeier aytunch danagbemava-nc gaaclarke kaankoken nelsoncamposCW talp-flytrex


text:
_DatePickerDialogState._handleEntryModeToggle. (date_picker.dart:467

Is there an existing issue for this?

[X] I have searched the existing issues
[X] I have read the guide to filing a bug

Steps to reproduce
When i upgrade to flutter 3.16.0
Logs
Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Null check operator used on a null value. Error thrown while handling a gesture.
       at _DatePickerDialogState._handleEntryModeToggle.<fn>(date_picker.dart:467)
       at State.setState(framework.dart:1203)
       at _DatePickerDialogState._handleEntryModeToggle(date_picker.dart:460)
       at _InkResponseState.handleTap(ink_well.dart:1183)
       at GestureRecognizer.invokeCallback(recognizer.dart:275)
       at TapGestureRecognizer.handleTapUp(tap.dart:652)
       at BaseTapGestureRecognizer._checkUp(tap.dart:309)
       at BaseTapGestureRecognizer.acceptGesture(tap.dart:279)
       at GestureArenaManager.sweep(arena.dart:167)
       at GestureBinding.handleEvent(binding.dart:492)
       at GestureBinding.dispatchEvent(binding.dart:468)
       at RendererBinding.dispatchEvent(binding.dart:439)
       at GestureBinding._handlePointerEventImmediately(binding.dart:413)
       at GestureBinding.handlePointerEvent(binding.dart:376)
       at GestureBinding._flushPointerEventQueue(binding.dart:323)
       at GestureBinding._handlePointerDataPacket(binding.dart:292)

Flutter Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.16.0, on macOS 13.4 22F66 darwin-x64, locale en-VN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] VS Code (version 1.84.2)
[✓] Connected device (2 available)
[✓] Network resources

When opening an issue, please try to provide all or some of the information indicated in the template so that we can address this issue properly.
More specifically, please provide the information indicated below:

A completed and minimal reproducible code sample
The output of flutter doctor -v
Reproduction steps

Thank you!

I am experiencing the same problem.


text:
DragGestureRecognizer: Option to not track scale gestures

Is there an existing issue for this?

[X] I have searched the existing issues
[X] I have read the guide to filing a bug

Use case
I need to detect pan gestures inside an InteractiveViewer. But a DragGestureRecognizer inside the InteractiveViewer also absorbs any scale gestures. I would like to let all gestures through, that start with more than one pointer, so the user can move the InteractiveViewer with two fingers, while he can interact with the draggable stuff inside using just one finger.
As a workaround, I implemented my own recogniser. I just built a proxy on the resolve method. Since everything in DragGestureRecognizer is private, I had to track the pointers myself:
class PanNoScaleGestureRecognizer extends PanGestureRecognizer {
  PanNoScaleGestureRecognizer({
    super.allowedButtonsFilter,
    super.debugOwner,
    super.supportedDevices,
  });

  final _pointerIds = <int>{};
  var _resolved = false;

  @override
  void startTrackingPointer(int pointer, [Matrix4? transform]) {
    _pointerIds.add(pointer);
    super.startTrackingPointer(pointer, transform);
  }

  @override
  void stopTrackingPointer(int pointer) {
    _pointerIds.remove(pointer);
    super.stopTrackingPointer(pointer);
  }

  @override
  void didStopTrackingLastPointer(int pointer) {
    _resolved = false;
    super.didStopTrackingLastPointer(pointer);
  }

  @override
  void resolve(GestureDisposition disposition) {
    if (!_resolved && disposition == GestureDisposition.accepted && _pointerIds.length > 1) {
      disposition = GestureDisposition.rejected;
    }
    if (disposition == GestureDisposition.accepted && !_resolved) {
      _resolved = true;
    }
    super.resolve(disposition);
  }
}

Complete drop-in widget for everyone, who just needs it
class DragNoScaleGestureDetector extends StatelessWidget {
  final GestureDragDownCallback? onPanDown;
  final GestureDragStartCallback? onPanStart;
  final GestureDragUpdateCallback? onPanUpdate;
  final GestureDragEndCallback? onPanEnd;
  final GestureDragCancelCallback? onPanCancel;

  final GestureDragDownCallback? onVerticalDragDown;
  final GestureDragStartCallback? onVerticalDragStart;
  final GestureDragUpdateCallback? onVerticalDragUpdate;
  final GestureDragEndCallback? onVerticalDragEnd;
  final GestureDragCancelCallback? onVerticalDragCancel;

  final GestureDragDownCallback? onHorizontalDragDown;
  final GestureDragStartCallback? onHorizontalDragStart;
  final GestureDragUpdateCallback? onHorizontalDragUpdate;
  final GestureDragEndCallback? onHorizontalDragEnd;
  final GestureDragCancelCallback? onHorizontalDragCancel;

  final DragStartBehavior dragStartBehavior;
  final HitTestBehavior? behavior;
  final Set<PointerDeviceKind>? supportedDevices;
  final bool excludeFromSemantics;

  final Widget? child;

  const DragNoScaleGestureDetector({
    super.key,
    this.child,
    this.onPanDown,
    this.onPanStart,
    this.onPanUpdate,
    this.onPanEnd,
    this.onPanCancel,
    this.onVerticalDragDown,
    this.onVerticalDragStart,
    this.onVerticalDragUpdate,
    this.onVerticalDragEnd,
    this.onVerticalDragCancel,
    this.onHorizontalDragDown,
    this.onHorizontalDragStart,
    this.onHorizontalDragUpdate,
    this.onHorizontalDragEnd,
    this.onHorizontalDragCancel,
    this.behavior,
    this.excludeFromSemantics = false,
    this.dragStartBehavior = DragStartBehavior.start,
    this.supportedDevices,
  });

  @override
  Widget build(BuildContext context) {
    final gestureSettings = MediaQuery.maybeGestureSettingsOf(context);

    return RawGestureDetector(
      behavior: behavior,
      excludeFromSemantics: excludeFromSemantics,
      gestures: {
        if (onPanDown != null ||
            onPanStart != null ||
            onPanUpdate != null ||
            onPanEnd != null ||
            onPanCancel != null)
          PanNoScaleGestureRecognizer:
              GestureRecognizerFactoryWithHandlers<PanNoScaleGestureRecognizer>(
            () => PanNoScaleGestureRecognizer(),
            (PanNoScaleGestureRecognizer instance) {
              instance
                ..onDown = onPanDown
                ..onStart = onPanStart
                ..onUpdate = onPanUpdate
                ..onEnd = onPanEnd
                ..onCancel = onPanCancel
                ..dragStartBehavior = dragStartBehavior
                ..gestureSettings = gestureSettings
                ..supportedDevices = supportedDevices;
            },
          ),
        if (onVerticalDragDown != null ||
            onVerticalDragStart != null ||
            onVerticalDragUpdate != null ||
            onVerticalDragEnd != null ||
            onVerticalDragCancel != null)
          VerticalDragNoScaleGestureRecognizer:
              GestureRecognizerFactoryWithHandlers<VerticalDragNoScaleGestureRecognizer>(
            () => VerticalDragNoScaleGestureRecognizer(),
            (VerticalDragNoScaleGestureRecognizer instance) {
              instance
                ..onDown = onVerticalDragDown
                ..onStart = onVerticalDragStart
                ..onUpdate = onVerticalDragUpdate
                ..onEnd = onVerticalDragEnd
                ..onCancel = onVerticalDragCancel
                ..dragStartBehavior = dragStartBehavior
                ..gestureSettings = gestureSettings
                ..supportedDevices = supportedDevices;
            },
          ),
        if (onHorizontalDragDown != null ||
            onHorizontalDragStart != null ||
            onHorizontalDragUpdate != null ||
            onHorizontalDragEnd != null ||
            onHorizontalDragCancel != null)
          HorizontalDragNoScaleGestureRecognizer:
              GestureRecognizerFactoryWithHandlers<HorizontalDragNoScaleGestureRecognizer>(
            () => HorizontalDragNoScaleGestureRecognizer(),
            (HorizontalDragNoScaleGestureRecognizer instance) {
              instance
                ..onDown = onHorizontalDragDown
                ..onStart = onHorizontalDragStart
                ..onUpdate = onHorizontalDragUpdate
                ..onEnd = onHorizontalDragEnd
                ..onCancel = onHorizontalDragCancel
                ..dragStartBehavior = dragStartBehavior
                ..gestureSettings = gestureSettings
                ..supportedDevices = supportedDevices;
            },
          ),
      },
      child: child,
    );
  }
}

class PanNoScaleGestureRecognizer extends PanGestureRecognizer with DragNoScaleGestureRecognizer {
  PanNoScaleGestureRecognizer({
    super.allowedButtonsFilter,
    super.debugOwner,
    super.supportedDevices,
  });
}

class VerticalDragNoScaleGestureRecognizer extends VerticalDragGestureRecognizer
    with DragNoScaleGestureRecognizer {
  VerticalDragNoScaleGestureRecognizer({
    super.allowedButtonsFilter,
    super.debugOwner,
    super.supportedDevices,
  });
}

class HorizontalDragNoScaleGestureRecognizer extends HorizontalDragGestureRecognizer
    with DragNoScaleGestureRecognizer {
  HorizontalDragNoScaleGestureRecognizer({
    super.allowedButtonsFilter,
    super.debugOwner,
    super.supportedDevices,
  });
}

mixin DragNoScaleGestureRecognizer on DragGestureRecognizer {
  final _pointerIds = <int>{};
  var _resolved = false;

  @override
  void startTrackingPointer(int pointer, [Matrix4? transform]) {
    _pointerIds.add(pointer);
    super.startTrackingPointer(pointer, transform);
  }

  @override
  void stopTrackingPointer(int pointer) {
    _pointerIds.remove(pointer);
    super.stopTrackingPointer(pointer);
  }

  @override
  void didStopTrackingLastPointer(int pointer) {
    _resolved = false;
    super.didStopTrackingLastPointer(pointer);
  }

  @override
  void resolve(GestureDisposition disposition) {
    if (!_resolved && disposition == GestureDisposition.accepted && _pointerIds.length > 1) {
      disposition = GestureDisposition.rejected;
    }
    if (disposition == GestureDisposition.accepted && !_resolved) {
      _resolved = true;
    }
    super.resolve(disposition);
  }
}

Proposal
Add a new parameter to DragGestureRecognizer, maybe called resolveWhenMultiplePointers, which only allows it to resolve, when it is tracking exactly one pointer. Also cascade it to all three variants of DragGestureRecognizer and to the GestureDetector widget.

Have you tried adjusting the gestureSettings on your inner recognizer? With lower touchSlop you should be able to get it to always claim single finger gestures instead of the InteractiveViewer.

@moffatman I tried it right now.
Firstly, the problem is the other way around. The inner recognizer does absorb all gestures, including those that should control the InteractiveViewer (namely: the scale gestures with 2 pointers).
So turning your suggestion around, I tried to increase the touchSlop. But the touchSlop is just the distance a pointer needs to move in order to accept the gesture. This does not depend on the number of pointers tracked by the recognizer and it also leads to some really unpredictable and undesired behavior, when you create a margin between the touchSlop values of different recognizers that are tracking the same movements.
Thanks for the effort, but this is not a solution for the problem...

Oh I misunderstood the problem. So it works now with your custom recognizer? And this issue is just to track including this feature into the stock PanGestureRecognizer for others to use?

Yes.
This is an obvious shortcoming in the framework and I think I am not the first having this problem. Flutter is used daily by many inexperienced developers, who just expect things to work and don't have the time nor the know-how to fix these kinds of issues. This is my way of making this world a better place. Also, my way feels a bit hacky.

Sure, feel free to open a PR, I'll review it

Also just to clarify, the desired behaviour is as below?

1 finger = pointer captured by the content within InteractiveViewer
2 fingers = first pointer now captured by InteractiveViewer along with second pointer, and the content is panned/zoomed on movement?
3+ fingers = continue to add to InteractiveViewer

Maybe you can use a new parameter int? maximumPointers on the DragGestureRecognizer? Although it means I should probably revisit the long standing issue that trackpad gestures count as one "pointer" in terms of pointerCount.

authors: Dampfwalze moffatman