Placeholder Image

Subtitles section Play video

  • Sometimes, you just need a little bit of space.

  • Wait, no, not like that.

  • I meant space between widgets.

  • You can add padding or size boxes, but you'd have to know if the gap is inside a column or row to specify the direction that the space should expand.

  • Both options can get verbose, potentially making your code harder to read.

  • Instead, you can add a gap.

  • It's like a size box, but you don't have to keep track of whether it's inside a row or column.

  • You always get a gap that takes up the specified space in the parent container's main access direction.

  • It works inside scrollable widgets like ListViews, too.

  • If you're working with a small amount of space, avoiding overflow, maxGap will only fill the available space up to your specified size.

  • Finally, for some custom scrolling action, check out sliverGap. So next time you need some space, add a gap.

  • For more info on gap and all the other packages, head to pub.dev.

Sometimes, you just need a little bit of space.

Subtitles and vocabulary

Click the word to look it up Click the word to find further inforamtion about it