themisir / form-validator

Simplest form validation for flutter form widgets
https://pub.dev/packages/form_validator
MIT License
77 stars 39 forks source link

Add DropdownButtonFormField Support #47

Closed Bekzod101001 closed 1 year ago

Bekzod101001 commented 1 year ago

Is your feature request related to a problem? Please describe. Make available to use ValidationBuilder not only for TextFormField, but for other elements like DropdownButtonFormField

Describe the solution you'd like

DropdownButtonFormField(
  validator: ValidationBuilder().required().build(),
),

Right now it's returning error

"The argument type 'String? Function(String?)' can't be assigned to the parameter type 'String? Function(dynamic)?'. (Documentation)"

themisir commented 1 year ago

Have you tried using annotating field widget explicitly like DropdownButtonFormField<String>?