-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
Description
Hello everyone. First of all, thanks for creating the bloc linter. I am delighted with it. I just wanted to bring something up for discussion that I think is mistakenly flagged by the lint rule avoid_public_bloc_methods.
In my bloc, I have a public getter which I use as a utility getter in order to access a bool variable. This bool variable is declared and initialized inside my bloc, and it's static.
Now, this getter is flagged by the avoid_public_bloc_methods rule, which I understand why, but I think it shouldn't be. My understanding is that this rule exists so we won't use a public method to alter the state inside the bloc, and instead use the events of the bloc to do this.
The getter is not used to change the state, so I find it a bit irrelevant to flag this with avoid_public_bloc_methods.
Steps To Reproduce
- Create a getter inside a bloc (example:
bool get hello => false;)
Expected Behavior
Do not mark methods/getters that don't change the state with the rule avoid_public_bloc_methods.