build method
Implementation
@override
Widget build(BuildContext context) {
var theme = Theme.of(context);
var ls = items.mapList((e) => DropdownMenuItem<T>(value: e.value, child: Center(child: Text(e.label.toString()))));
return DropdownButtonFormField<T>(
value: value,
isExpanded: true,
style: TextStyle(fontSize: 14, color: theme.textTheme.labelMedium?.color ?? Colors.black87),
alignment: AlignmentDirectional.centerEnd,
items: ls,
hint: hint,
onChanged: (e) {
value = e;
updateState();
if (onChanged != null) {
onChanged!(value);
}
},
);
}