Flutter onPressed of a Button on a ListView gets called automatically (when it becomes visible). Is this a bug?

 onPressed: inviteClicked(employee),

should be

 onPressed: () => inviteClicked(employee),

to pass a callback function instead of the result of a function call.

Share