Skip to content

Instantly share code, notes, and snippets.

@slightfoot
Last active August 1, 2025 13:59
Show Gist options
  • Select an option

  • Save slightfoot/a75d6c368f1b823b594d9f04bf667231 to your computer and use it in GitHub Desktop.

Select an option

Save slightfoot/a75d6c368f1b823b594d9f04bf667231 to your computer and use it in GitHub Desktop.

Revisions

  1. slightfoot revised this gist May 2, 2018. No changes.
  2. slightfoot created this gist May 2, 2018.
    29 changes: 29 additions & 0 deletions column_builder.dart
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@

    class ColumnBuilder extends StatelessWidget {
    final IndexedWidgetBuilder itemBuilder;
    final MainAxisAlignment mainAxisAlignment;
    final MainAxisSize mainAxisSize;
    final CrossAxisAlignment crossAxisAlignment;
    final TextDirection textDirection;
    final VerticalDirection verticalDirection;
    final int itemCount;

    const ColumnBuilder({
    Key key,
    @required this.itemBuilder,
    @required this.itemCount,
    this.mainAxisAlignment: MainAxisAlignment.start,
    this.mainAxisSize: MainAxisSize.max,
    this.crossAxisAlignment: CrossAxisAlignment.center,
    this.textDirection,
    this.verticalDirection: VerticalDirection.down,
    }) : super(key: key);

    @override
    Widget build(BuildContext context) {
    return new Column(
    children: new List.generate(this.itemCount,
    (index) => this.itemBuilder(context, index)).toList(),
    );
    }
    }