passsy / dart-lint

An opinionated, community-driven set of lint rules for Dart and Flutter projects. Like pedantic but stricter
Apache License 2.0
277 stars 82 forks source link

SizedBox for whitespace warning #19

Closed merojosa closed 3 years ago

merojosa commented 3 years ago

Hello, guys. I just update lint 1.3.0. in one of my projects.

Then, I got a warning with this code:

@override
Widget build(BuildContext context) {
   return Container(width: 270, child: _video);
}

The warnings says SizedBox for whitespace.

image

I think it's a false positive. What do you think?

passsy commented 3 years ago

No, your Container can be replaced with SizedBox.

@override
Widget build(BuildContext context) {
   return SizedBox(width: 270, child: _video);
}
merojosa commented 3 years ago

Indeed you're right. My bad, I forgot that a SizedBox can have a child widget. Thanks!