Functions are first-class objects in Dart and can be passed as parameters to other functions. We pass a function to a widget essentially saying, invoke this function when something happens . Callbacks using interfaces like Android have too much boilerplate code for a simple callback.
Read moreHow do you pass a function flutter?
Dart: How to pass a function into a function (using a Function as a method parameter)
Read moreHow do you pass parameters in flutter?
You can accomplish this task using the arguments parameter of the Navigator.
Read more