I have a registration form with multiple text feilds and a Radio button and a birthdate picker. I want to disable the submit button untill the user key in all the required feilds. I managed to do something but it only validates one text feild.
bool activateTheButton =false;
@override
initState(){
super.initState();
nameController = TextEditingController();
nameController.addListener(() {
final activateTheButton = nameController.text.isNotEmpty;
setState(() => this.activateTheButton = activateTheButton);
......................
ElevatedButton( onPressed: activateTheButton
? (){
}: null,
}
How can I make it so that all the textfeilds along with the radio button and date of birth must have data first then activate button?
your help is highly appreciated.