avoid-notifier-constructors
Warns when a Notifier
(or AsyncNotifier
) has a non-empty constructor.
Example
❌ Bad:
class Counter extends Notifier<int> {
var state = 0;
// LINT
Counter() {
state = 1;
}
int build() {
return state;
}
void increment() {
state++;
}
}
✅ Good:
class Counter extends Notifier<int> {
int build() {
return 0;
}
void increment() {
state++;
}
}