Gap (Package of the Week)

preview_player
Показать описание
Use Gap to add space between widgets without keeping track of whether its parent is a Row or Column.

#PackageOfTheWeek
Рекомендации по теме
Комментарии
Автор

This should be in Flutter instead of an external package.

mateusfccp
Автор

It should be in Flutter and not external package and should be a parameter to the Layout Widgets. I can only find something like this in Wrap Widget, of which I think you can make it applicable to Row, Column and the likes.👍

ahmadkhidir
Автор

It's great for reducing code but it should be implemented inside Flutter and not a package. Hopefully in next updates they will consider adding it to flutter base.

YoutuGer
Автор

Adding an additional package just to add space does not make sense it should be Flutter widget.

AAAKhan-rfwk
Автор

For achieving this. I created an extension for sizedbox height and width by giving a value 10.x means sizebox with 10 width vice versa

mehranullah
Автор

I can predict a huge refactoring in my codebase in the coming days 😅

ThomasGallinari
Автор

Agree. A lot of packages should be in the Flutter core

fredericgomes
Автор

Very cool, didn't know about Gap and MaxGap, sounds very useful

TadejKanizar
Автор

So basically, you (and my OCD) are telling me that I need to update all my code replacing SizedBoxes with Gaps!!! :)

evanwallace
Автор

I've, created the exact same Gap and SliverGap widgets over 4 years ago and it seems scarily similar in code, I only start directly with a LeafRenderObjectWidget instead of first creating a StatelessWidget

stefanklerkx
Автор

really cool👍
Can't wait to implement it on slivers

lydiabazova
Автор

I build widget like this on external repo, this widget called SpaceWidget, have multi constructors for vertical & horizontal..etc, instance for empty gap NullRender element

MohammadAbureesh
Автор

Damn, I made my own widgets: But Gap looks awesome! Thanks Flutter team.

adianblabla
Автор

People saying I created the same -> my gap is a square sized box don't understand one thing, if your gap is larger than for example the width of your column, you change the layout.
SizedBox(width:30, height:30) is not the same as SizedBox(width:30)

gaxkiller
Автор

Now i need to replace all SizeBox with Gap 😂😂

ahmadullah.saikat
Автор

they made the most interesting part the shortest

antongrekov
Автор

It's insane there is no built-in method of adding a gap to a list widget. We shouldn't have to put any widget between every single child to make something like this work.

sstream
Автор

I believe that Column and Row should have gap properties similar to the "display: flex" property in CSS.

jar
Автор

Time to add this inside my code without the package import :P

VictorKun
Автор

Please. This is the only thing CSS has gotten right. Adding gap to rows and columns would be a game changer. Gap can’t be a package for god’s sake 🙆🏻‍♂️

aakashr