feat:增加主题色
This commit is contained in:
@@ -3,8 +3,11 @@ import 'package:task_hub/pages/home_page.dart';
|
||||
import 'package:task_hub/pages/schedule_page.dart';
|
||||
import 'package:task_hub/pages/settings_page.dart';
|
||||
import 'package:task_hub/pages/task_page.dart';
|
||||
import 'package:window_size/window_size.dart';
|
||||
|
||||
void main() {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
setWindowMinSize(const Size(800, 600));
|
||||
runApp(const TaskHubApp());
|
||||
}
|
||||
|
||||
@@ -14,10 +17,11 @@ class TaskHubApp extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return FluentApp(
|
||||
title: 'TaskHub',
|
||||
title: '拾光记',
|
||||
themeMode: ThemeMode.system,
|
||||
theme: FluentThemeData(
|
||||
fontFamily: 'CustomFont',
|
||||
accentColor: Colors.purple
|
||||
),
|
||||
debugShowCheckedModeBanner: false,
|
||||
home: const MainLayout(),
|
||||
@@ -34,53 +38,36 @@ class MainLayout extends StatefulWidget {
|
||||
|
||||
class _MainLayoutState extends State<MainLayout> {
|
||||
int _currentIndex = 0;
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return NavigationView(
|
||||
titleBar: TitleBar(
|
||||
icon: const FlutterLogo(),
|
||||
title: const Text('TaskHub')
|
||||
),
|
||||
titleBar: TitleBar(title: const Text('拾光记')),
|
||||
pane: NavigationPane(
|
||||
selected: _currentIndex,
|
||||
onChanged: (index) => setState(() => _currentIndex = index),
|
||||
size: NavigationPaneSize(
|
||||
openWidth: 150
|
||||
),
|
||||
size: NavigationPaneSize(openWidth: 150),
|
||||
items: [
|
||||
PaneItem(
|
||||
icon: const Icon(FluentIcons.home),
|
||||
title: const Text('首页'),
|
||||
body: Container(
|
||||
color: Colors.white,
|
||||
child: const HomePage(),
|
||||
),
|
||||
body: Container(color: Colors.white, child: const HomePage()),
|
||||
),
|
||||
PaneItem(
|
||||
icon: const Icon(FluentIcons.check_list),
|
||||
title: const Text('待办'),
|
||||
body: Container(
|
||||
color: Colors.white,
|
||||
child: const TaskPage(),
|
||||
),
|
||||
body: Container(color: Colors.white, child: const TaskPage()),
|
||||
),
|
||||
PaneItem(
|
||||
icon: const Icon(FluentIcons.calendar),
|
||||
title: const Text('日程'),
|
||||
body: Container(
|
||||
color: Colors.white,
|
||||
child: const SchedulePage(),
|
||||
),
|
||||
body: Container(color: Colors.white, child: const SchedulePage()),
|
||||
),
|
||||
PaneItemSeparator(),
|
||||
PaneItem(
|
||||
icon: const Icon(FluentIcons.settings),
|
||||
title: const Text('设置'),
|
||||
body: Container(
|
||||
color: Colors.white,
|
||||
child: const SettingsPage(),
|
||||
),
|
||||
body: Container(color: Colors.white, child: const SettingsPage()),
|
||||
),
|
||||
],
|
||||
footerItems: [
|
||||
@@ -96,4 +83,4 @@ class _MainLayoutState extends State<MainLayout> {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user