Skip to content

Instantly share code, notes, and snippets.

@psygo
Created October 19, 2020 01:50
Show Gist options
  • Save psygo/9f265f909bede6ae4583462248dc37f7 to your computer and use it in GitHub Desktop.
Save psygo/9f265f909bede6ae4583462248dc37f7 to your computer and use it in GitHub Desktop.
Mixins vs Extensions in Dart

Mixins vs Extensions in Dart

The Major Differences

  • Mixins allow for an adapted multiple inheritance.
    • Though they have the limitation that you cannot have mixins inheriting mixins.
  • Extensions let you add new methods to a class but not state (new instance variables).
    • But you can use stuff like the Expando object.
    • They can't override methods either.

More Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment