Problem
In lib/features/updater/update_available_badge.dart, an AnimatedBuilder is used to create a pulsing animation for the update badge. However, it completely ignores the child parameter.
Because the builder function recreates the inner Row, Icon, and Text widgets instead of accepting them via child, the framework is forced to rebuild those static elements on every single frame (60 or 120 times per second) while the animation is running.
Proposed Solution
Refactor the AnimatedBuilder to pass the static Row and its contents into the child property, and only update the container's decoration (color/border) in the builder closure.
Trade-offs
- Pros: Reduces CPU usage and garbage collection pressure during the continuous pulse animation.
- Cons: Slightly more verbose code structure.
Impact
- Risk: Zero. Behavior remains visually identical.
Problem
In
lib/features/updater/update_available_badge.dart, anAnimatedBuilderis used to create a pulsing animation for the update badge. However, it completely ignores thechildparameter.Because the
builderfunction recreates the innerRow,Icon, andTextwidgets instead of accepting them viachild, the framework is forced to rebuild those static elements on every single frame (60 or 120 times per second) while the animation is running.Proposed Solution
Refactor the
AnimatedBuilderto pass the staticRowand its contents into thechildproperty, and only update the container's decoration (color/border) in thebuilderclosure.Trade-offs
Impact