-
Notifications
You must be signed in to change notification settings - Fork 1.8k
use_decorated_box seems to be wrong: Its fix is not equivalent and changes UI #58683
Copy link
Copy link
Open
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagelinter-false-positiveIssues related to lint rules that report a problem when it isn't a problem.Issues related to lint rules that report a problem when it isn't a problem.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Metadata
Metadata
Assignees
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagelinter-false-positiveIssues related to lint rules that report a problem when it isn't a problem.Issues related to lint rules that report a problem when it isn't a problem.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Hi thanks for the linter! I use linter a lot, and when the
use_decorated_boxsuggests me to replaceContainerwithDecoratedBoxI did that. Later I realized it has bugs.A very simple reproducible sample is like:
With its auto-fixed DecoratedBox version:
Suppose originally the page is 100x100 pixel. Then, the
MyChildWidgetinContainerversion will be 99x99, while that inDecoratedBoxversion will be 100x100 - no padding is automatically added to avoid the children to collide with the decoration! This caused some of my UI to have subtle bugs later on.By the way, we can confirm this when looking at source code of Container:
So, if Container.decoration exists, it will automatically extra pad itself.