StraitWidget constructor
A StraitWidget is as Strait running widget, it executes your Method and gets the output. You need a StraitWidget around every strait content
StraitWidget((List<Widget> cont) {
...
});
Implementation
StraitWidget(Function(List<Widget>) strait) {
var content = <Widget>[];
var b = StraitWidget.builder;
StraitWidget.builder = RestActionBuilder(content);
dynamic ret = strait(content);
// Process return (if given)
if (ret != null) {
if (ret is RestAction) {
if (ret.called) ret.queue();
} else if (ret is List<RestAction>) {
for (var e in ret) {
if (!e.called) e.queue();
}
} else if (ret is Widget) {
content.add(ret);
} else if (ret is List<Widget>) {
content.addAll(ret);
}
}
StraitWidget.builder = b;
result = content;
}