-
Notifications
You must be signed in to change notification settings - Fork 34
Description
There is a repeating feature request in Flutter to add separators for children of Row and Column:
flutter/flutter#16957
flutter/flutter#18917
flutter/flutter#55378
flutter/flutter#95263
flutter/flutter#95521
At its highest it got 117 thumbs-ups.
But it is declined over and over again because it can be solved outside of the framework with a few lines of code:
Iterable<T> alternateWith(Iterable<T> items, T separator) {
return items
.expand((item) sync* { yield separator; yield item; })
.skip(1);
}Can we add it to this package as an extension on Iterable? One could then do:
Column(
children: <Widget>[
Widget1(),
Widget2(),
].alternateWith(separator).toList(),
),One could easily make another package with this, as there are many. Yet they are unknown and may be poorly maintained. This package is widely used, endorsed, and can be referred to in Flutter docs thus ending the recurrance of the feature request or speeding up the debate should it occur again.
I can do it myself if approved.