-
-
Notifications
You must be signed in to change notification settings - Fork 127
Fix layout offset on physical Android devices after closing feedback #366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Fix layout offset on physical Android devices after closing feedback #366
Conversation
When closing the feedback view on physical Android devices, the main app content remains offset to the right/down. This fix explicitly positions the screenshot widget at Offset.zero when feedback is not displayed. This addresses the issue reported in ueman#322 where the layout remains offset after interacting with the feedback view on physical Android devices. Potentially related to ueman#322
|
Thanks!
Can you please post your testing steps? also, can you try writing a widget test, please? |
Add widget test to ensure screenshot positioning behavior is maintained. The test verifies that the screenshot widget is positioned at (0,0) when feedback is closed, both initially and after closing feedback. Note: This is a regression test that passes with or without the fix, as the actual layout offset issue only occurs on physical Android devices and cannot be reproduced in the test environment.
PR Update: Added Widget TestImportant Note on TestingThe layout offset issue only occurs on physical Android devices and cannot be reproduced in the Flutter test environment. The widget test is primarily a regression test to ensure our fix doesn't break existing functionality. Testing StepsManual Testing on Physical Android Device (Required for Bug Verification)
Widget Test (Regression Testing)I've added a widget test at Important: Test Limitations
What the Test Covers:
Running the Test:cd feedback
flutter test test/feedback_layout_test.dart
# or with fvm:
fvm flutter test test/feedback_layout_test.dartSummaryThe one-line fix ( The actual bug verification must be done through manual testing on a physical Android device. |
|
This fixed the issue in our web app. Thanks @go-run-jump! I've switch to go-run-jump's branch for now. Hope we can get this through soon. |
Summary
This PR fixes a layout offset issue on physical Android devices where the main app content remains offset to the right/down after closing the feedback view.
The Issue
On physical Android devices running Flutter 3.24+, when users open and then close the feedback view (either by submitting feedback or cancelling), the underlying application screen content remains offset. This issue does not occur on Android emulators.
The Fix
The fix is simple - explicitly position the screenshot widget at
Offset.zerowhen feedback is not displayed in the_FeedbackLayoutDelegate.performLayoutmethod.Testing
This fix has been tested on a physical Android device and resolves the offset issue.
Related Issues
This addresses the issue reported in #322
Type of Change