Skip to content

Files

Latest commit

 

History

History
26 lines (19 loc) · 578 Bytes

prefer_mixin.md

File metadata and controls

26 lines (19 loc) · 578 Bytes

Pattern: Missing use of mixin

Issue: -

Description

Dart 2.1 introduced a new syntax for mixins that provides a safe way for a mixin to invoke inherited members using super. The new style of mixins should always be used for types that are to be mixed in. As a result, this lint will flag any uses of a class in a with clause.

Example of incorrect code:

class A {}
class B extends Object with A {}

OK:

mixin M {}
class C with M {}

Further Reading