DropDownItems<T> static method
Implementation
static List<DropdownMenuItem<T>>? DropDownItems<T>(
List<T> stateData,
String Function(T) displayFunc,
) {
return stateData
.map<DropdownMenuItem<T>>((value) => DropdownMenuItem<T>(
value: value, // add this property an pass the _value to it
child: Row(
children: [
Padding(
padding: const EdgeInsets.only(top: 7),
child: Text(displayFunc(value)),
),
],
),
))
.toList();
}