-1

I have a proplem in assigning a sign in future method to onpressed :The argument type 'Future' can't be assigned to the parameter type 'void Function()'.

Omar Yacop
  • 37
  • 1
  • 9

1 Answers1

4

you have to assign it like this:

onpressed: () => FunctionName()

Because the handler expects a function with no return. So we just call your function inside an anonymous void function.

Benedikt J Schlegel
  • 1,707
  • 1
  • 10
  • 23