You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Move bloc_lint documentation from /packages/bloc_lint/doc to bloclibrary.dev.
Add more information of WHY this lint rule exists on documentation page.
Examples given by @zbarbuto during the discussion:
avoid_public_method_on_bloc
Blocs are intended to be interacted with by adding events via the .add() method only. By exposing public methods it may be tempting to treat the bloc as if it were a cubit.
avoid_public_properties_on_bloc_and_cubit
Exposing public properties can lead to anti-patterns such as having public state that is not part of the state property or using repositories and services exposed by the bloc in the widget tree that should be accessed via other means such as RepositoryProvider.of() or context.read<T>()
prefer_multi_bloc_listener MultiBlocListeners reduce nesting, make it easier to see what blocs are provided at the current widget tree level and can make refactoring easier.
Outside of the discussion but could be cool to add it :
Add "exists from: 0.1.0" on documentation page.
The text was updated successfully, but these errors were encountered:
I’d love to help add the bloc_lint documentation to bloclibrary.dev. Based on the discussion in #4278, here’s the approach I would take:
1. Moving Documentation: I’ll transfer the existing documentation from /packages/bloc_lint/doc to bloclibrary.dev.
2. Expanding Rule Descriptions: I’ll add explanations on why each lint rule exists, following the examples provided by @zbarbuto:
• avoid_public_method_on_bloc: To prevent misuse by encouraging .add() as the sole interaction method.
• avoid_public_properties_on_bloc_and_cubit: To prevent anti-patterns such as exposing properties that shouldn’t be accessed directly.
• prefer_multi_bloc_listener: To improve readability, reduce nesting, and simplify refactoring by using MultiBlocListener.
3. Including Version Information: I’ll add “exists from: 0.1.0” to indicate when each rule was introduced.
Please let me know if this sounds good or if there’s anything specific to add. I’m looking forward to contributing!
I’d love to help add the bloc_lint documentation to bloclibrary.dev. Based on the discussion in #4278, here’s the approach I would take: 1. Moving Documentation: I’ll transfer the existing documentation from /packages/bloc_lint/doc to bloclibrary.dev. 2. Expanding Rule Descriptions: I’ll add explanations on why each lint rule exists, following the examples provided by @zbarbuto: • avoid_public_method_on_bloc: To prevent misuse by encouraging .add() as the sole interaction method. • avoid_public_properties_on_bloc_and_cubit: To prevent anti-patterns such as exposing properties that shouldn’t be accessed directly. • prefer_multi_bloc_listener: To improve readability, reduce nesting, and simplify refactoring by using MultiBlocListener. 3. Including Version Information: I’ll add “exists from: 0.1.0” to indicate when each rule was introduced.
Please let me know if this sounds good or if there’s anything specific to add. I’m looking forward to contributing!
Thanks!
Thanks for the interest and offering to help! I’d hold off for a few days since I’m in the process of proposing new lint rules (the original was more of a proof of concept). Once we’ve nailed down the initial batch of lint rules we can split up the work implementing and documenting each one. Hope that makes sense, thanks!
Description
According to the discussion on #4278 between @felangel and @zbarbuto :
Examples given by @zbarbuto during the discussion:
Outside of the discussion but could be cool to add it :
The text was updated successfully, but these errors were encountered: