- ScheduleDetail, ScheduleMember, RelatedDate 모델 추가 - getSchedule API 서비스 함수 추가 - schedule_detail_view.dart 구현 (유튜브, X, 콘서트, 기본 섹션) - 라우터에 /schedule/:id 경로 추가 - 일정 목록 및 검색 결과에서 상세 화면 이동 기능 추가 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
95 lines
2.8 KiB
Dart
95 lines
2.8 KiB
Dart
/// 앱 라우터 설정
|
|
library;
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:go_router/go_router.dart';
|
|
import '../views/main_shell.dart';
|
|
import '../views/home/home_view.dart';
|
|
import '../views/members/members_view.dart';
|
|
import '../views/album/album_view.dart';
|
|
import '../views/album/album_detail_view.dart';
|
|
import '../views/album/album_gallery_view.dart';
|
|
import '../views/album/track_detail_view.dart';
|
|
import '../views/schedule/schedule_view.dart';
|
|
import '../views/schedule/schedule_detail_view.dart';
|
|
|
|
/// 네비게이션 키
|
|
final GlobalKey<NavigatorState> rootNavigatorKey = GlobalKey<NavigatorState>();
|
|
|
|
/// 앱 라우터 설정
|
|
final GoRouter appRouter = GoRouter(
|
|
navigatorKey: rootNavigatorKey,
|
|
initialLocation: '/',
|
|
routes: [
|
|
// 메인 셸 (바텀 네비게이션)
|
|
ShellRoute(
|
|
builder: (context, state, child) => MainShell(child: child),
|
|
routes: [
|
|
GoRoute(
|
|
path: '/',
|
|
pageBuilder: (context, state) => const NoTransitionPage(
|
|
child: HomeView(),
|
|
),
|
|
),
|
|
GoRoute(
|
|
path: '/members',
|
|
pageBuilder: (context, state) => const NoTransitionPage(
|
|
child: MembersView(),
|
|
),
|
|
),
|
|
GoRoute(
|
|
path: '/album',
|
|
pageBuilder: (context, state) => const NoTransitionPage(
|
|
child: AlbumView(),
|
|
),
|
|
),
|
|
GoRoute(
|
|
path: '/schedule',
|
|
pageBuilder: (context, state) => const NoTransitionPage(
|
|
child: ScheduleView(),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
// 앨범 상세 (셸 외부)
|
|
GoRoute(
|
|
path: '/album/:name',
|
|
parentNavigatorKey: rootNavigatorKey,
|
|
builder: (context, state) {
|
|
final albumName = state.pathParameters['name']!;
|
|
return AlbumDetailView(albumName: albumName);
|
|
},
|
|
),
|
|
// 트랙 상세 (셸 외부)
|
|
GoRoute(
|
|
path: '/album/:albumName/track/:trackTitle',
|
|
parentNavigatorKey: rootNavigatorKey,
|
|
builder: (context, state) {
|
|
final albumName = state.pathParameters['albumName']!;
|
|
final trackTitle = state.pathParameters['trackTitle']!;
|
|
return TrackDetailView(
|
|
albumName: albumName,
|
|
trackTitle: trackTitle,
|
|
);
|
|
},
|
|
),
|
|
// 앨범 갤러리 (컨셉포토 전체보기)
|
|
GoRoute(
|
|
path: '/album/:name/gallery',
|
|
parentNavigatorKey: rootNavigatorKey,
|
|
builder: (context, state) {
|
|
final albumName = state.pathParameters['name']!;
|
|
return AlbumGalleryView(albumName: albumName);
|
|
},
|
|
),
|
|
// 일정 상세 (셸 외부)
|
|
GoRoute(
|
|
path: '/schedule/:id',
|
|
parentNavigatorKey: rootNavigatorKey,
|
|
builder: (context, state) {
|
|
final scheduleId = int.parse(state.pathParameters['id']!);
|
|
return ScheduleDetailView(scheduleId: scheduleId);
|
|
},
|
|
),
|
|
],
|
|
);
|