Skip to content

Instantly share code, notes, and snippets.

@saliouseck2009
Created April 15, 2022 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saliouseck2009/9d7cc5275e5534a912f245e15a066202 to your computer and use it in GitHub Desktop.
Save saliouseck2009/9d7cc5275e5534a912f245e15a066202 to your computer and use it in GitHub Desktop.
Flutter : Create VoidCallBack with args
typedef Int2VoidFunc = void Function(int);
// or: typedef void Int2VoidFunc(int arg);
class MyOtherClass {
final Int2VoidFunc callback;
MyOtherClass(this.callback);
void callCallaback() { callback(5); }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment