talira

Flutter widgets for adding gaps inside Rows, Columns and scroll views

open sourceMITfree

gap adds empty space between widgets in a Flutter Column, Row or scrolling view without wrapping them in Padding or choosing between SizedBox's width and height. A Gap takes its extent along the parent's direction, so the same widget works in rows, columns and ListViews. MaxGap fills up to a size and shrinks to avoid overflow, SliverGap does the same in a CustomScrollView, and a Gap can take a color and a cross-axis extent.

Problems it solves

  • add spacing between widgets in a Flutter Column without SizedBox everywhere
  • put a fixed gap between children of a Row or Column in Flutter
  • add space between slivers in a Flutter CustomScrollView

Features

  • Gap widget that sizes itself along its Flex parent's direction
  • works inside scrollables such as ListView
  • MaxGap that shrinks to avoid overflow
  • SliverGap for CustomScrollView
  • optional color and cross-axis extent