Skip to content

[Android] PlatformView pointer events (tap & drag) are horizontally mirrored in RTL mode #182823

Description

@GF-Allen

Steps to reproduce

rtl_platform_view_gesture_demo.zip

  1. Set the Android system language to an RTL language (e.g., Arabic).
  2. Ensure android:supportsRtl="true" is set in AndroidManifest.xml.
  3. Run the provided reproduction sample.
  4. Click "click blue" area.
  5. Try to drag or scroll the view from the blue area and observe the movement.

Expected results

  1. Click "click blue" area should display "click blue"
  2. Dragging should move the content according to the finger's actual position.

Actual results

  1. The SnackBar displays "click red" (or the action associated with the mirrored horizontal position). This confirms that touch coordinates are being horizontally inverted before reaching the PlatformView.
  2. Dragging is mirrored: Dragging on the mirrored position causes the WebView to move, confirming that the entire coordinate space is flipped.

Code sample

Code sample
<application
        android:label="rtl_platform_view_gesture_demo"
        android:name="${applicationName}"
        android:supportsRtl="true"
        android:icon="@mipmap/ic_launcher">
Row(
            mainAxisAlignment: .spaceAround,
            children: [
              SizedBox(
                width: 150,
                height: 150,
                child: Center(
                  child: InkWell(
                    onTap: () {
                      _showSnackBar('click blue');
                    },
                    child: Container(
                      width: 100,
                      height: 100,
                      color: Colors.blue,
                      child: const Center(
                        child: Text('click blue', style: TextStyle(color: Colors.white)),
                      ),
                    ),
                  ),
                ),
              ),
              Container(
                width: 150,
                height: 150,
                child: Stack(
                  children: [
                    Positioned.fill(child: WebViewWidget(controller: _controller)),
                    Center(
                      child: InkWell(
                        onTap: () {
                          _showSnackBar('click red');
                        },
                        child: Container(
                          width: 100,
                          height: 100,
                          alignment: AlignmentDirectional.center,
                          color: Colors.red,
                          child: Text('click red', style: TextStyle(color: Colors.white)),
                        ),
                      ),
                    ),
                  ],
                ),
              ),
            ],
          ),

Screenshots or Video

Screenshots / Video demonstration
Screen_recording_20260224_171112.mp4

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.41.2, on macOS 15.6.1 24G90 darwin-arm64, locale zh-Hans-CN) [2.2s]
    • Flutter version 3.41.2 on channel stable at /Users/xq/fvm/versions/3.41.2
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 90673a4eef (6 days ago), 2026-02-18 13:54:59 -0800
    • Engine revision 6c0baaebf7
    • Dart version 3.11.0
    • DevTools version 2.54.1
    • Flutter download mirror https://storage.flutter-io.cn
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations,
      enable-native-assets, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration

[!] Android toolchain - develop for Android devices (Android SDK version 35.0.1) [3.5s]
    • Android SDK at /Users/xq/Dev/SDK/Android/
    • Emulator version 36.1.9.0 (build_id 13823996) (CL:N/A)
    • Platform android-36, build-tools 35.0.1
    • ANDROID_HOME = /Users/xq/Dev/SDK/Android/
    • Java binary at: /Applications/Android Studio 2.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.7+-13880790-b1038.58)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[!] Xcode - develop for iOS and macOS (Xcode 16.2) [3.4s]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16C5032a
    ! CocoaPods 1.15.2 out of date (1.16.2 is recommended).
        CocoaPods is a package manager for iOS or macOS platform code.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/to/platform-plugins
      To update CocoaPods, see https://guides.cocoapods.org/using/getting-started.html#updating-cocoapods

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

[✓] Connected device (3 available) [6.3s]
    • sdk gphone16k arm64 (mobile) • emulator-5554 • android-arm64  • Android 15 (API 35) (emulator)
    • macOS (desktop)              • macos         • darwin-arm64   • macOS 15.6.1 24G90 darwin-arm64
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 145.0.7632.75
    ! Device 1C27294610DA10TZ is not authorized.
      You might need to check your device for an authorization dialog.

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

! Doctor found issues in 2 categories.

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: platform-viewsEmbedding Android/iOS views in Flutter appsengineflutter/engine related. See also e: labels.team-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions