Any efficient way (simplify the code or not using a method but a variable expression) for the same result?
static List<Tab> myTabs() {
List<String> des = customType.map((e) => e.description).toList() ;
List<Tab> result = [];
for (var d in des) {
result.add(Tab(text: d));
}
return result;
}
You can do something like this. Just directly adding the
Tabwidget to a listOr even use the fat arrow (
=>) syntax: