skip to Main Content
            RadioListTile(
              value: 1,
              groupValue: selectedRadio,
              title: Text("Doctor" , style: TextStyle(fontSize: 19.0)),
              activeColor: Colors.green,
              onChanged: (val) {
                setSelectedRadio(val);
                //print(selectedRadio);
              },
            ),

on the val variable i am getting this error of The argument type ‘Object?’ can’t be assigned to the parameter type ‘int’.

2

Answers


  1. Try changing it to

    setSelectedRadio(val as int);
    
    Login or Signup to reply.
  2. Instead of passing whole Object just pass the id of selectedRadio Object

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search