avoid-bloc-public-methods
Warns when a Bloc
has public methods except the overridden ones.
Additional resources:
Example
❌ Bad:
class CounterBloc extends Bloc<CounterEvent, int> {
CounterBloc() : super(0);
// LINT
void changeSate(int newState) {
state = newState;
}
void onChange(Change<int> change) {
super.onChange(change);
print(change);
}
void _listenToChange() {}
}
✅ Good:
class CounterBloc extends Bloc<CounterEvent, int> {
CounterBloc() : super(0);
void onChange(Change<int> change) {
super.onChange(change);
print(change);
}
void _listenToChange() {}
}