I want to create a list of widgets MyWidget(categoryName, color) from the following two lists.
static const _categoryNames = <String>['Length','Area','Volume', ]; static const _baseColors = <Color>[ Colors.teal, Colors.orange, Colors.pinkAccent, ];In Python I would use a list comprehension with zip to get the result.
my_widget_list = [MyWidget(categoryName, baseColor) for categoryName, baseColor in zip(_categoryNames, _baseColors)]Googling for a similar method for Dart did not provide any satisfactory solution.