[PR #93] [MERGED] [core] Fix Index Reset for Tabs in Small Deck Layout #94

Closed
opened 2025-10-31 16:57:13 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/feeddeck/feeddeck/pull/93
Author: @ricoberger
Created: 12/1/2023
Status: Merged
Merged: 12/1/2023
Merged by: @ricoberger

Base: mainHead: core-fix-index-reset-for-tabs-in-small-deck-layout


📝 Commits (1)

  • d22a372 [core] Fix Index Reset for Tabs in Small Deck Layout

📊 Changes

1 file changed (+1 additions, -0 deletions)

View changed files

📝 app/lib/widgets/deck/deck_layout_small.dart (+1 -0)

📄 Description

The index was not reset in the DeckLayoutSmall widget, when the user selected a new deck in the settings widget. This was caused because the DefaultTabController was not rebuild after a new deck was selected, so that the initialIndex value was not used.

This is now fixed by adding a key to the DefaultTabController, which corresponds to the selected deck. This means if the user selects a new deck in the settings the widget will be rebuild and the initial selected tab will be the first one. If a user selects the same deck or switches between the small and large layout the tab will be the formerly selected one.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/feeddeck/feeddeck/pull/93 **Author:** [@ricoberger](https://github.com/ricoberger) **Created:** 12/1/2023 **Status:** ✅ Merged **Merged:** 12/1/2023 **Merged by:** [@ricoberger](https://github.com/ricoberger) **Base:** `main` ← **Head:** `core-fix-index-reset-for-tabs-in-small-deck-layout` --- ### 📝 Commits (1) - [`d22a372`](https://github.com/feeddeck/feeddeck/commit/d22a37201ce727b49977b80106513d56d8f07f62) [core] Fix Index Reset for Tabs in Small Deck Layout ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `app/lib/widgets/deck/deck_layout_small.dart` (+1 -0) </details> ### 📄 Description The index was not reset in the `DeckLayoutSmall` widget, when the user selected a new deck in the settings widget. This was caused because the `DefaultTabController` was not rebuild after a new deck was selected, so that the `initialIndex` value was not used. This is now fixed by adding a `key` to the `DefaultTabController`, which corresponds to the selected deck. This means if the user selects a new deck in the settings the widget will be rebuild and the initial selected tab will be the first one. If a user selects the same deck or switches between the small and large layout the tab will be the formerly selected one. <!-- Keep PR title verbose enough and add prefix telling about what source it touches e.g "[rss] Add feature xyz" or if the the PR is not realated to a source use "[core]", e.g. "[core] Fix xyz". If you add a breaking change within your PR you should add ":warning:" to the title, e.g. ":warning: [core] My breaking change" --> <!-- Description of what have been changed. Please also reference an issue, when available. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-10-31 16:57:13 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/feeddeck#94