flutter validate radio buttons
问题 How can I add a validator function to a list of RadioButtons in order to have them validated (like TextFormFields with _formKey.currentState.validate() ) after the User submits the Form ? 回答1: You can copy paste run full code below You can use package https://pub.dev/packages/flutter_form_builder It support bulid-in validators such as FormBuilderValidators.required() you can directly use you can also use custom validator function https://pub.dev/packages/flutter_form_builder#custom-validator