I created a method below to loop through my list because I don't want to write again and again of these few lines but the parameter I pass to the Text widget and also value argument are error and it said Invalid constant value. How can I achieve this? I'm new to flutter. Please help me.
PopupMenuItem _createMenuItems(final String a) {
return const PopupMenuItem(
value: a,
child: Text(a),
);
}