Skip to content

Instantly share code, notes, and snippets.

@savioserra
Created January 31, 2020 22:23
Show Gist options
  • Save savioserra/5553ac0e5bf1ceb63b1159101ebb50da to your computer and use it in GitHub Desktop.
Save savioserra/5553ac0e5bf1ceb63b1159101ebb50da to your computer and use it in GitHub Desktop.
abstract class Test {
final String value;
Test(this.value);
}
abstract class Test2 {
final String value;
Test2(String i) : value = i;
}
class Store {}
class AppController = Test with Store;
class AppController2 = Test2 with Store;
void main() {
var test1 = AppController(inject()); // prints 'dynamic'
var test2 = AppController2(inject()); // prints 'String'
}
T inject<T>() {
print(T);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment