Description
There are numerous occurrences of empty setState(() {}) calls triggering full re-renders across the codebase.
Why is this a problem?
Calling setState without updating a specific state variable often implies that the widget is reacting to an external variable or Listenable changing, or simply forcing a whole-tree rebuild. This is an anti-pattern that leads to unnecessary UI redraws and can cause jank on complex panels.
Proposed Solution
Refactor these calls to use scoped reactive builders like ValueListenableBuilder, ListenableBuilder, or scoped state management solutions. This ensures that only the exact sub-tree dependent on the data is rebuilt, saving CPU cycles.
Areas affected
MongoDatabaseDialog
RedisExplorerView
PreferencesAppearanceSection
- Various other widgets using this pattern.
Description
There are numerous occurrences of empty
setState(() {})calls triggering full re-renders across the codebase.Why is this a problem?
Calling
setStatewithout updating a specific state variable often implies that the widget is reacting to an external variable orListenablechanging, or simply forcing a whole-tree rebuild. This is an anti-pattern that leads to unnecessary UI redraws and can cause jank on complex panels.Proposed Solution
Refactor these calls to use scoped reactive builders like
ValueListenableBuilder,ListenableBuilder, or scoped state management solutions. This ensures that only the exact sub-tree dependent on the data is rebuilt, saving CPU cycles.Areas affected
MongoDatabaseDialogRedisExplorerViewPreferencesAppearanceSection