chore: Use photoviewer as auto route page#432
Merged
PartyDonut merged 1 commit intodevelopfrom Aug 3, 2025
Merged
Conversation
Contributor
Reviewer's GuideThis PR replaces manual navigation for viewing photo/album items with a fully integrated auto_route solution by defining a new PhotoViewerRoute, annotating the PhotoViewerScreen for auto_route, and updating all navigation calls to use context.navigateTo or context.router.push with the generated route. Sequence diagram for navigation to PhotoViewerScreen using auto_routesequenceDiagram
actor User
participant UI as FolderDetailScreen/LibraryViews/PhotoAlbumExtension
participant Context
participant AutoRouter
participant PhotoViewerScreen
User->>UI: Selects a photo/album item
UI->>Context: context.navigateTo(PhotoViewerRoute(...))
Context->>AutoRouter: Handles navigation
AutoRouter->>PhotoViewerScreen: Instantiates with args
PhotoViewerScreen-->>User: Displays photo viewer
Class diagram for the new PhotoViewerRoute and PhotoViewerScreen integrationclassDiagram
class PhotoViewerRoute {
+List<PhotoModel>? items
+String? selected
+Future<List<PhotoModel>>? loadingItems
+Key? key
}
class PhotoViewerRouteArgs {
+List<PhotoModel>? items
+String? selected
+Future<List<PhotoModel>>? loadingItems
+Key? key
}
class PhotoViewerScreen {
+List<PhotoModel>? items
+String? selected
+Future<List<PhotoModel>>? loadingItems
+Key? key
}
PhotoViewerRoute --> PhotoViewerRouteArgs
PhotoViewerRouteArgs --> PhotoViewerScreen : used by
PhotoViewerRoute --> PhotoViewerScreen : builds
PhotoViewerScreen <|-- _PhotoViewerScreenState
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey @PartyDonut - I've reviewed your changes - here's some feedback:
- You’re mixing context.navigateTo(...) and context.router.push(...); consider consolidating on one (e.g. always using context.router.push) for consistent auto_route navigation.
- Rather than using rawQueryParams for the selectedId on '/album', you might define it as a path parameter (e.g. '/album/:selectedId') so the route and URLs are more intuitive and easier to deep-link.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- You’re mixing context.navigateTo(...) and context.router.push(...); consider consolidating on one (e.g. always using context.router.push) for consistent auto_route navigation.
- Rather than using rawQueryParams for the selectedId on '/album', you might define it as a path parameter (e.g. '/album/:selectedId') so the route and URLs are more intuitive and easier to deep-link.
## Individual Comments
### Comment 1
<location> `lib/screens/photo_viewer/photo_viewer_controls.dart:133` </location>
<code_context>
@override
void dispose() {
timerController.dispose();
- fullScreenHelper.closeFullScreen(ref);
+ if (context.mounted) {
+ fullScreenHelper.closeFullScreen(ref);
+ }
</code_context>
<issue_to_address>
Checking context.mounted before calling closeFullScreen may be unnecessary.
Since closeFullScreen only uses ref and not BuildContext, you can remove the context.mounted check for clarity if widget lifecycle is not involved.
</issue_to_address>
<suggested_fix>
<<<<<<< SEARCH
if (context.mounted) {
fullScreenHelper.closeFullScreen(ref);
}
=======
fullScreenHelper.closeFullScreen(ref);
>>>>>>> REPLACE
</suggested_fix>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Comment on lines
133
to
135
| timerController.dispose(); | ||
| fullScreenHelper.closeFullScreen(ref); | ||
| if (context.mounted) { | ||
| fullScreenHelper.closeFullScreen(ref); | ||
| } | ||
| windowManager.removeListener(this); | ||
| super.dispose(); |
Contributor
There was a problem hiding this comment.
suggestion: Checking context.mounted before calling closeFullScreen may be unnecessary.
Since closeFullScreen only uses ref and not BuildContext, you can remove the context.mounted check for clarity if widget lifecycle is not involved.
Suggested change
| fullScreenHelper.closeFullScreen(ref); | |
| if (context.mounted) { | |
| fullScreenHelper.closeFullScreen(ref); | |
| } | |
| windowManager.removeListener(this); | |
| super.dispose(); | |
| fullScreenHelper.closeFullScreen(ref); |
Julien9969
pushed a commit
to Julien9969/Fladder
that referenced
this pull request
Sep 7, 2025
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
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.
Pull Request Description
Use routes for viewing photo/album items