feat:更新主题颜色布局
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:fluent_ui/fluent_ui.dart';
|
||||
import 'package:hive_flutter/adapters.dart';
|
||||
import 'package:task_hub/models/task.dart';
|
||||
@@ -56,32 +58,37 @@ class _MainLayoutState extends State<MainLayout> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final iconColor = FluentTheme.of(context).accentColor;
|
||||
final paneColor = FluentTheme.of(context).accentColor.lightest;
|
||||
|
||||
return NavigationView(
|
||||
titleBar: TitleBar(title: const Text('拾光记')),
|
||||
titleBar: TitleBar(
|
||||
title: const Text('拾光记', style: TextStyle(fontSize: 18)),
|
||||
),
|
||||
pane: NavigationPane(
|
||||
selected: _currentIndex,
|
||||
onChanged: (index) => setState(() => _currentIndex = index),
|
||||
size: NavigationPaneSize(openWidth: 150),
|
||||
items: [
|
||||
PaneItem(
|
||||
icon: const Icon(FluentIcons.home),
|
||||
title: const Text('首页'),
|
||||
body: Container(color: Colors.white, child: const HomePage()),
|
||||
icon: Icon(FluentIcons.home, color: iconColor),
|
||||
title: const Text('首页', style: TextStyle(fontSize: 16)),
|
||||
body: Container(color: paneColor, child: const HomePage()),
|
||||
),
|
||||
PaneItem(
|
||||
icon: const Icon(FluentIcons.check_list),
|
||||
title: const Text('待办'),
|
||||
body: Container(color: Colors.white, child: const TaskPage()),
|
||||
icon: Icon(FluentIcons.check_list, color: iconColor),
|
||||
title: const Text('待办', style: TextStyle(fontSize: 16)),
|
||||
body: Container(color: paneColor, child: const TaskPage()),
|
||||
),
|
||||
PaneItem(
|
||||
icon: const Icon(FluentIcons.calendar),
|
||||
title: const Text('日程'),
|
||||
body: Container(color: Colors.white, child: const SchedulePage()),
|
||||
icon: Icon(FluentIcons.calendar, color: iconColor),
|
||||
title: const Text('日程', style: TextStyle(fontSize: 16)),
|
||||
body: Container(color: paneColor, child: const SchedulePage()),
|
||||
),
|
||||
PaneItemSeparator(),
|
||||
PaneItem(
|
||||
icon: const Icon(FluentIcons.settings),
|
||||
title: const Text('设置'),
|
||||
icon: Icon(FluentIcons.settings, color: iconColor),
|
||||
title: const Text('设置', style: TextStyle(fontSize: 16)),
|
||||
body: Container(color: Colors.white, child: const SettingsPage()),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user