What is the difference between type specifying a variable as Function vs Function().
When I declare a variable as
final Function? btnOkOnPress;
And then use/call it like this
btnOkOnPress?.call();
I get a warning/problem saying, Avoid method calls or property accesses on a "dynamic" target.
But when I declare it like
final Function()? btnOkOnPress;
There is no such warning, why is that?
Why is it calling target as dynamic even though it is defined as Function.