refactor(example): optimize widget rendering and manage state efficiently#18
Merged
Conversation
…rash - Decouple state logic from direct strategy instances - Prevent re-entrant state updates in the main layout - Isolate strategy specific metadata to ensure slider bounds respect physical limits - De-duplicate and string buffer loop allocations
…Tile StatelessWidget
8e2e142 to
8a1bc07
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR introduces critical structural refactoring and performance optimizations to the
exampleapplication's UI, addressing hot reload state issues and reducing expensive widget rebuilds.Commits & Changes
e3a7eab):availableAppStrategiesto a getter so that Flutter's Hot Reload evaluates new minimum length parameters correctly.8to allow users to generate passwords below length16when manual policy rules are disabled.d48481f,38aec59):_buildFilterChipinto a newStrategyFilterChipStatelessWidget._buildRequirementTileinto a newPolicyRequirementTileStatelessWidget.8a1bc07):ListenableBuilderfrommain.dartthat caused the whole page to drop frames on layout recalculations.ListenableBuilders deep into individual sub-widgets (PasswordDisplay,PolicyControlsCard, etc.).BackdropFilterUI blur widgets to prevent them from recalculating across every frame of a slider drag.MockGeneratorStatefor robust local unit testing ofPasswordDisplay.