Skip to content

Instantly share code, notes, and snippets.

@lukepighetti
Last active February 18, 2019 14:21
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 lukepighetti/b4f766621b01ffa5270e5de93ef592b5 to your computer and use it in GitHub Desktop.
Save lukepighetti/b4f766621b01ffa5270e5de93ef592b5 to your computer and use it in GitHub Desktop.
Mixin error
class Cook = Person with AwesomeCookingSkills;
class Person {
final String name;
Person(this.name);
}
mixin AwesomeCookingSkills on Person {
String get bestDish => "$name makes the best chocolate.";
}
main() {
final miyoyo = Cook("Miyoyo");
/// Error: The superclass, 'Person', has no unnamed constructor that takes no arguments.
print(miyoyo.bestDish);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment