퀘스트 제목 다국어 · HOME 다시 읽기 · 내 퀘스트 검토 중·반려됨 구분
This commit is contained in:
@@ -98,6 +98,7 @@ GoRouter buildRouter(AuthRepository auth, {Repositories? repositories}) {
|
||||
final linker = repos.linker(auth.providers);
|
||||
return GoRouter(
|
||||
initialLocation: appTabs.first.path,
|
||||
observers: [HomeRefreshObserver()],
|
||||
refreshListenable: auth,
|
||||
redirect: (context, state) {
|
||||
final at = state.matchedLocation;
|
||||
@@ -151,6 +152,7 @@ GoRouter buildRouter(AuthRepository auth, {Repositories? repositories}) {
|
||||
builder: (_, _, shell) => AppShell(shell: shell, flags: repos.flags),
|
||||
branches: [
|
||||
StatefulShellBranch(
|
||||
observers: [HomeRefreshObserver()],
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: appTabs[0].path,
|
||||
@@ -259,11 +261,15 @@ class AppShell extends StatelessWidget {
|
||||
child: NavigationBar(
|
||||
// 숨긴 탭에 머무는 동안(딥링크 등)에는 선택 표시를 첫 탭으로 둔다.
|
||||
selectedIndex: selected < 0 ? 0 : selected,
|
||||
onDestinationSelected: (i) => shell.goBranch(
|
||||
branches[i],
|
||||
// initialLocation: true 를 주면 이미 열려 있는 탭을 다시 누를 때 루트로 되돌아간다.
|
||||
initialLocation: branches[i] == shell.currentIndex,
|
||||
),
|
||||
onDestinationSelected: (i) {
|
||||
// 다른 탭에서 HOME 으로 돌아오면 다시 읽는다(HOME 은 탭 전환으로 다시 만들어지지 않는다).
|
||||
if (branches[i] == 0 && shell.currentIndex != 0) homeRefreshSignal.value++;
|
||||
shell.goBranch(
|
||||
branches[i],
|
||||
// initialLocation: true 를 주면 이미 열려 있는 탭을 다시 누를 때 루트로 되돌아간다.
|
||||
initialLocation: branches[i] == shell.currentIndex,
|
||||
);
|
||||
},
|
||||
destinations: [
|
||||
for (final tab in tabs)
|
||||
NavigationDestination(
|
||||
|
||||
Reference in New Issue
Block a user