-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Disabling switching router layouts after init #191
Conversation
Reviewer's Guide by SourceryThis PR disables switching router layouts after the size/layout has been set. This addresses issue #174 by ensuring the router layout is only initialized once and prevents it from being re-initialized when the screen size or layout changes. Class diagram showing AdaptiveLayoutBuilder changesclassDiagram
class AdaptiveLayoutBuilder {
<<ConsumerStatefulWidget>>
}
class _AdaptiveLayoutBuilderState {
-LayoutState layout
-ScreenLayout size
-AutoRouter? router
-TargetPlatform currentPlatform
-ScrollController controller
+updateSize()
+build()
}
note for _AdaptiveLayoutBuilderState "Router is now nullable and initialized only once"
AdaptiveLayoutBuilder --> _AdaptiveLayoutBuilderState
State diagram for router layout initialization behaviorstateDiagram-v2
[*] --> Uninitialized: App starts
Uninitialized --> Initialized: First layout/size setting
Initialized --> Initialized: Screen size changes
note right of Initialized: Router layout remains fixed
note left of Uninitialized: router is null
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @PartyDonut - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding tests to verify the router initialization behavior and ensure it doesn't get recreated after the initial setup.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Review instructions: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Pull Request Description
This disables switching routers when the size/layout has already been decided.
Issue Being Fixed
Resolves #174
Checklist