Skip to content

Instantly share code, notes, and snippets.

@JCzz
Last active December 23, 2018 21:12
Show Gist options
  • Select an option

  • Save JCzz/c417f62f2134a7ab828b36ba70564a8d to your computer and use it in GitHub Desktop.

Select an option

Save JCzz/c417f62f2134a7ab828b36ba70564a8d to your computer and use it in GitHub Desktop.
// import 'dart:async';
typedef void PrintFunction<T>(String p1, T p2);
class ClassA<String, T> {
String str;
T myprinter;
ClassA({this.str, this.myprinter});
}
class ClassB {
String str;
}
main() {
var smallClass = ClassB();
var hello = "input string";
PrintFunction<ClassB> mp = (hello, smallClass)=> print('Hello from PrintFunction');
ClassA s = ClassA(
str: "",
myprinter: mp
);
s.myprinter();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment