flutter_slick_lints 0.2.0
flutter_slick_lints: ^0.2.0 copied to clipboard
Custom analyzer lints for flutter_slick view models, screens and routes.
0.2.0 #
avoid_state_calls_in_init_state:loading(),idle()andredraw()in a view model'sinitState()reach nothing — the widget shows the loading view until it completes, then callsidle()itself. Ships a delete quick-fix.avoid_notify_during_build: a view model notification made while the view builds is thesetState() called during builderror.use_on_redirect: a route that overridesredirectreplaces Slick's dispatch toonRedirect, so the guard written there never runs. Ships a rename quick-fix.use_navigation_logic: a route change made through go_router directly —route.go(context),context.go(...),GoRouter.of(context).go(...)— loses the history entry, the dirty-state reset and the page snapshot. Inside a view model, the quick-fix rewrites it asnavigation.goTo(route).use_slick_page_host: abuildPageoverride that dropsSlickPageHostdrops the page out of snapshot loading, in both directions.avoid_redundant_redrawnow checks that the neighbouringloading()/idle()actually notifies. Both return early when the loading flag already holds the value they would set, soredraw(); idle();with noloading()before it is the one notification in that method — the rule used to report it, and its fix would have dropped the update. The rule also stays quiet when a branch, a loop or atrymakes the loading state unreadable, and leavesinitState()toavoid_state_calls_in_init_state.
0.1.0 #
- First release.
avoid_redundant_redraw: aredraw()next to aloading()oridle()draws the view a second time, because those two notify when they change the loading state. Ships a quick-fix that deletes the line.