Skip to content

Instantly share code, notes, and snippets.

@jmewes
Last active May 31, 2020 06:53
Show Gist options
  • Select an option

  • Save jmewes/3cb5a843b371a0afa4b321f1b7e1025a to your computer and use it in GitHub Desktop.

Select an option

Save jmewes/3cb5a843b371a0afa4b321f1b7e1025a to your computer and use it in GitHub Desktop.
Define interface for variables #dart
void main() {
var obj = ConcreteClass("test");
print(obj.myVariable);
}
class ConcreteClass extends AbstractClass {
String myVariable;
ConcreteClass(String myVariable) {
this.myVariable = myVariable;
}
}
abstract class AbstractClass {
String get myVariable;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment