Add support for nested artifacts (probably going to switch back to push() due to an apparent bug in GoRouter)

This commit is contained in:
Shawn 2024-01-11 10:15:30 -07:00
parent 44300dbe23
commit 2853af8f61
2 changed files with 3 additions and 3 deletions

View File

@ -34,13 +34,13 @@ class _ArtifactScreenState extends State<ArtifactCarouselScreen> {
_currentArtifactIndex.value = _wrappedPageIndex; _currentArtifactIndex.value = _wrappedPageIndex;
} }
void _handleSearchTap() => context.push(ScreenPaths.search(widget.type)); void _handleSearchTap() => context.go(ScreenPaths.search(widget.type));
void _handleArtifactTap(int index) { void _handleArtifactTap(int index) {
int delta = index - _currentPage.value.round(); int delta = index - _currentPage.value.round();
if (delta == 0) { if (delta == 0) {
HighlightData data = _artifacts[index % _artifacts.length]; HighlightData data = _artifacts[index % _artifacts.length];
context.push(ScreenPaths.artifact(data.artifactId)); context.go(ScreenPaths.artifact(data.artifactId));
} else { } else {
_pageController?.animateToPage( _pageController?.animateToPage(
_currentPage.value.round() + delta, _currentPage.value.round() + delta,

View File

@ -65,7 +65,7 @@ class _ArtifactSearchScreenState extends State<ArtifactSearchScreen> with GetItS
_updateFilter(); _updateFilter();
} }
void _handleResultPressed(SearchData o) => context.push(ScreenPaths.artifact(o.id.toString())); void _handleResultPressed(SearchData o) => context.go(ScreenPaths.artifact(o.id.toString()));
void _handlePanelControllerChanged() { void _handlePanelControllerChanged() {
settingsLogic.isSearchPanelOpen.value = panelController.value; settingsLogic.isSearchPanelOpen.value = panelController.value;