Steps to reproduce
- open vscode
- run
Flutter: New Project - choose
Application - add to
dev_dependencies
integration_test:
sdk: flutter
- copy
testfolder and rename it tointegration_test - connect an android physical machine
- open
integration_test/widget_test.dart - press the Run button to the left of the
testWidgets
- after the test, you will find that the button appears in the wrong place
Expected results
button doesn't appears in the wrong place
Actual results
button appears in the wrong place
Code sample
Code samplehttps://github.com/luo2430/dart_code_issue_5922
Screenshots or Video
Screenshots / Video demonstration[Upload media here]
Logs
Logs[Paste your logs here]Flutter Doctor output
Doctor output[!] Flutter (Channel [user-branch], 3.41.1, on Microsoft Windows [版本 10.0.26200.7840], locale zh-CN) [338ms] ! Flutter version 3.41.1 on channel [user-branch] at C:\Users\24306\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/setup. ! Upstream repository unknown source is not a standard remote. Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error. • Framework revision 582a0e7c55 (11 days ago), 2026-02-12 17:12:32 -0800 • Engine revision 3452d735bd • Dart version 3.11.0 • DevTools version 2.54.1 • 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 • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades. [√] Windows Version (Windows 11 or higher, 25H2, 2009) [683ms] [!] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [402ms] • Android SDK at C:\Users\24306\AppData\Local\Android\sdk • Emulator version 36.4.9.0 (build_id 14788078) (CL:N/A) X cmdline-tools component is missing. Try installing or updating Android Studio. Alternatively, download the tools from https://developer.android.com/studio#command-line-tools-only and make sure to set the ANDROID_HOME environment variable. See https://developer.android.com/studio/command-line for more details. X Android license status unknown. Run `flutter doctor --android-licenses` to accept the SDK licenses. See https://flutter.dev/to/windows-android-setup for more details. [X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe) [194ms] ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable. [√] Visual Studio - develop Windows apps (Visual Studio 生成工具 2026 18.1.1) [193ms] • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools • Visual Studio 生成工具 2026 version 18.1.11312.151 • Windows 10 SDK version 10.0.26100.0 [√] Connected device (3 available) [215ms] • COR AL10 (mobile) • DWT7N18606005333 • android-arm64 • Android 9 (API 28) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [版本 10.0.26200.7840] • Edge (web) • edge • web-javascript • Microsoft Edge 145.0.3800.65 [√] Network resources [801ms] • All expected network resources are available. ! Doctor found issues in 3 categories.

