I have a list of Strings, e.g.,
var moviesTitles = ['Inception', 'Heat', 'Spider Man'];
and wanted to use moviesTitles.map to convert them to a list of Tab Widgets in Flutter.
I'm new to flutter. I found that one can also achieve it this way.
tabs: [
for (var title in movieTitles) Tab(text: title)
]
Note: It requires dart sdk version to be >= 2.3.0, see here