dropDownFormField<T> static method
Widget
dropDownFormField<T>({
- required T value,
- bool obscureText = false,
- TextInputType inputType = TextInputType.text,
- ValueChanged<
T?> ? onChanged, - required List<
T> items, - EdgeInsets padding = paddingStepOne,
- EdgeInsets margin = paddingStepOne,
Implementation
static Widget dropDownFormField<T>(
{required T value,
bool obscureText = false,
TextInputType inputType = TextInputType.text,
ValueChanged<T?>? onChanged,
required List<T> items,
EdgeInsets padding = paddingStepOne,
EdgeInsets margin = paddingStepOne}) =>
Container(
padding: padding,
margin: margin,
child: DropdownButtonFormField<T>(
dropdownColor: AppColors.mainColor,
elevation: 0,
decoration: inputDecoration(),
isExpanded: true,
value: value,
icon: Icon(
Icons.arrow_downward,
color: AppColors.textColor,
),
style: TextStyle(color: AppColors.textColor),
onChanged: onChanged,
items: items.map<DropdownMenuItem<T>>((T value) {
return DropdownMenuItem<T>(
value: value,
child: Text(value.toString()),
);
}).toList(),
));