Is it possible to pass a Function with parameters to a VoidCallback?
for example something like this:
class MyClass {
void doSomething(int i){
}
1) Create typedef first in any constant class:
typedef StringVoidFunc = void Function(String);
2) Pass from calling function class one
showAlertDialog(doSomething);
3) Call back handle Function
void doSomething(String i){
Navigator.pop(context);
setState(() {
});
}
4) From where you want to fire call back from Class Two
showAlertDialog(StringVoidFunc callback) {
callback("delete");
}