-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
[ReorderableListView] remove extra margin added after picking up the item #65080
[ReorderableListView] remove extra margin added after picking up the item #65080
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good change, with small change requests.
Also it'd be better if you can add a golden test to make sure it looks exactly how we want after picking up the item. If you're up for the challenge, refer to https://github.com/flutter/flutter/wiki/Writing-a-golden-file-test-for-package:flutter or search for matchesGoldenFile
in existing test files.
@@ -207,7 +207,7 @@ class _ReorderableListContentState extends State<_ReorderableListContent> with T | |||
static const double _defaultDropAreaExtent = 100.0; | |||
|
|||
// The additional margin to place around a computed drop area. | |||
static const double _dropAreaMargin = 8.0; | |||
static const double _dropAreaMargin = 0.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable should no longer be necessary. Remove to simplify code.
// The list view pads the drop area by 8dp. | ||
const double kDraggingListHeight = 300.0; | ||
// The list view pads the drop area by 0dp. | ||
const double kDraggingListHeight = 292.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Combine kNonDraggingListHeight
and kDraggingListHeight
to simplify code.
Thank you @dkwingsmt ! I've simplified the unnecessary code and added golden test. The images are in the description. :) |
The Linux analyzer seems unhappy. Can you resolve the lint errors? |
sorry for missing declaring |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Theoretically the bot should comment that a golden test has been modified... I'll check it out next week. |
Okay. Thank you for reviewing. Please let me know if there is anything I need to do. |
@dkwingsmt @nero-angela The golden tests added in this PR failed when I tried to revert a TextField layout PR from just before this: #66027 Can you guys think of any reason why that would happen? These new tests have nothing to do with TextField or InputDecoration layout, right? |
These images don't appear to have arrived on the gold dashboard after landing: https://flutter-gold.skia.org/ |
Looks like our luci recipes have been changed and disabled gold again. Will file an infra ticket. |
#64969 for tracking |
Description
As you can see under the gif when picking up an item in
ReorderableListView
, the others below the item move slightly downward. this is because the extra margin is added to the selected item after lifting. So I removed the extra margin and modified the related test.Golden test image
Related Issues
Fixes #58411
Tests
I modified the following tests:
Checklist
Before you create this PR, confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.///
).flutter analyze --flutter-repo
) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.