Is it possible to pass a Function with parameters to a VoidCallback?
for example something like this:
class MyClass {
void doSomething(int i){
}
Example in UI case. You may need create widget and pass click function.
1.Create widget with function as paramiter in constructor.
Container _cardButton({
Function onClickAction,
}) {
return Container(
width: 340,
height: 90,
child: InkWell(
splashColor: Colors.blue.withAlpha(30),
onTap: () {
onClickAction();
},
child: Card(
elevation: 5,
child: somechild,
),
),
);
2. Implement widget to the three view and pass function like this
_cardButton(
onClickAction: () => {debugPrint("CLICKED")},
),