Should I post an issue for variation in parameters

52 Views Asked by At

The parameter for StatefulBuilder's builder function are different in the website flutter.dev and the documentation pop-up window in android studio or vs code. In official website documentation it says that the second parameter is a StateSetter whereas in IDE it says void Function(void Function ()).

So, should I post it as an issue in the flutter's github for updation of documentation ? or shall I let it be ? I mean is there something I don't know technically ?.

1

There are 1 best solutions below

0
On BEST ANSWER

A StateSetter is a typedef for function signature void Function(VoidCallback fn), and VoidCallback is a typedef for void Function(), so basically

StateSetter = void Function(void Function())

It is just that IDEs usually resolve the typedefs to most primitive values, which is usually handy, but sometimes confusing as well.