For constructor

For({
  1. required Widget create(
    1. int
    ),
  2. required int to,
  3. int from = 0,
  4. int step = 1,
})

The For class enables you to add multiple endpoints to one Widget.

There is always a List of Widgets involved.

For(
	from: 0,
	to: 5,
	create: (index){
		return Command('/say ' + index.toString())
	}
)

Implementation

For({
  required Widget Function(int) create,
  required int to,
  int from = 0,
  int step = 1,
}) : _list = [] {
  for (var i = from; i <= to; i += step) {
    _list.add(create(i));
  }
}