skip to Main Content

please when create an elevated button and then give it an empty funtion it indicates an error which doesn’t allow my code to run. Even if i give it a simple function it still doesnt work. can someone please help me

i was expecting it to work. I even copied some solutions directly from here but still not working.a screenshot of the error

2

Answers


  1. Remove const keyword from hierarchy a function is not a const. that’s why it’s giving error.

    Login or Signup to reply.
  2. Pass the function like this

    onTap:(){}
    

    or

    onTap:()=>null
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search