1) From what I understand Voidcallback is a 'nickname' for void Function()
Correct. Because it is open-source, you have checked that it is the same as a function that has no return, and does not receive parameters. This can also be seen in documentation.
2) used only where the graphical part (UI) of the flutter is used
I imagine you deducted that from the line
part of dart.ui
. According to the documentation of that import:
Built-in types and core Primitives for a Flutter application.
Main built-in and primitive types for a flutter application.
[...] such as classes for Driving the input, Graphics text, layout, and Rendering subsystems.
[...] such as classes to drive data input, graphics, layout and render subsystems
(From the link above, free translation)
Therefore, we can realize that this import does not only deal with the part graphic, but of any other example among those cited.
It is important to note that it is not because this typedef
was defined in this import that it needs to be used solely and exclusively with the same goals. It is nothing more than a apelido
, a convenience to show what kind of function is expected. When someone reads VoidCallback
is immediate to what.
3) Is that right or has any other difference?
That’s all there is to it.