2025-07-11
작업 시작전 저장
This commit is contained in:
@@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
|
||||
import 'home_page.dart'; // HomePage에 콜백을 전달해야 하므로 import 경로 확인
|
||||
import 'plan_page.dart';
|
||||
import 'statistics_page.dart';
|
||||
import 'jobs_page.dart';
|
||||
import 'career_page.dart';
|
||||
import 'more_page.dart';
|
||||
import 'common/widgets/custom_bottom_nav_bar.dart';
|
||||
|
||||
@@ -31,14 +31,15 @@ class MyApp extends StatelessWidget {
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget {
|
||||
const MyHomePage({super.key});
|
||||
final int initialIndex;
|
||||
const MyHomePage({super.key, this.initialIndex = 0});
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage> {
|
||||
int _selectedIndex = 0;
|
||||
late int _selectedIndex;
|
||||
|
||||
// 각 탭에 연결될 페이지 위젯 리스트
|
||||
// HomePage는 StatefulWidget이므로 const를 붙이지 않습니다.
|
||||
@@ -48,6 +49,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_selectedIndex = widget.initialIndex;
|
||||
// *** 수정: HomePage 생성 시 onNavigateToPlanTab 콜백 전달 ***
|
||||
_widgetOptions = <Widget>[
|
||||
HomePage(onNavigateToPlanTab: _onItemTapped), // 콜백 함수 전달
|
||||
@@ -87,7 +89,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
appBarTitle = 'Statistics';
|
||||
}
|
||||
else if (_selectedIndex == 3) {
|
||||
appBarTitle = 'Jobs';
|
||||
appBarTitle = 'Career';
|
||||
}
|
||||
else if (_selectedIndex == 4) {
|
||||
appBarTitle = 'More';
|
||||
|
||||
Reference in New Issue
Block a user