Last active
December 23, 2018 21:12
-
-
Save JCzz/c417f62f2134a7ab828b36ba70564a8d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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