테마 기능 분리
구글 가변 폰트 추가 업커밍 존 카드 추출
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// main.dart
|
||||
|
||||
import 'package:csp2/common/theme/app_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// 새로 만든 페이지 파일들을 import 합니다.
|
||||
@@ -21,10 +22,7 @@ class MyApp extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
title: 'Case Study',
|
||||
theme: ThemeData(
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Color(0xFF2005E6)),
|
||||
useMaterial3: true,
|
||||
),
|
||||
theme: AppTheme.lightTheme,
|
||||
home: const MyHomePage(),
|
||||
);
|
||||
}
|
||||
@@ -80,25 +78,24 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// AppBar의 제목을 현재 탭에 따라 동적으로 변경
|
||||
String appBarTitle = 'Home'; // 기본값
|
||||
if (_selectedIndex == 1) {
|
||||
appBarTitle = 'Plan';
|
||||
}
|
||||
else if (_selectedIndex == 2) {
|
||||
appBarTitle = 'Statistics';
|
||||
}
|
||||
else if (_selectedIndex == 3) {
|
||||
appBarTitle = 'Career';
|
||||
}
|
||||
else if (_selectedIndex == 4) {
|
||||
appBarTitle = 'More';
|
||||
}
|
||||
// String appBarTitle = 'Home'; // 기본값
|
||||
// if (_selectedIndex == 1) {
|
||||
// appBarTitle = 'Plan';
|
||||
// }
|
||||
// else if (_selectedIndex == 2) {
|
||||
// appBarTitle = 'Statistics';
|
||||
// }
|
||||
// else if (_selectedIndex == 3) {
|
||||
// appBarTitle = 'Career';
|
||||
// }
|
||||
// else if (_selectedIndex == 4) {
|
||||
// appBarTitle = 'More';
|
||||
// }
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 40,
|
||||
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
|
||||
title: Text(appBarTitle), // 동적으로 변경된 AppBar 제목\
|
||||
title: Text("Case Study"), // 동적으로 변경된 AppBar 제목\
|
||||
actions: <Widget>[
|
||||
IconButton(
|
||||
icon: const Icon(Icons.notifications),
|
||||
|
||||
Reference in New Issue
Block a user