Search code examples
fluttergithubdartgithub-issues

Should I post an issue for variation in parameters


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 ?.


Solution

  • 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.