For constructor
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));
}
}