diff --git a/lib/main.dart b/lib/main.dart index fd0b25a..0f14fce 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -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 { @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()), ), ], diff --git a/lib/pages/home_page.dart b/lib/pages/home_page.dart index 8f4fff3..c85f78d 100644 --- a/lib/pages/home_page.dart +++ b/lib/pages/home_page.dart @@ -7,26 +7,18 @@ class HomePage extends StatelessWidget { Widget build(BuildContext context) { return ScaffoldPage.withPadding( header: const PageHeader( - title: Text('首页'), + title: Text('首页', style: TextStyle(color: Colors.white)), ), content: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Icon( - FluentIcons.home, - size: 64, - ), + Icon(FluentIcons.home, size: 64, color: Colors.white), const SizedBox(height: 20), - Text( - '首页', - style: TextStyle( - fontSize: 24, - ), - ), + Text('首页', style: TextStyle(fontSize: 24, color: Colors.white)), ], ), ), ); } -} \ No newline at end of file +} diff --git a/lib/pages/schedule_page.dart b/lib/pages/schedule_page.dart index 4d74359..45f4496 100644 --- a/lib/pages/schedule_page.dart +++ b/lib/pages/schedule_page.dart @@ -106,13 +106,13 @@ class _SchedulePageState extends State { Widget build(BuildContext context) { return ScaffoldPage.withPadding( header: PageHeader( - title: const Text('日程安排'), + title: const Text('日程安排', style: TextStyle(color: Colors.white)), commandBar: CommandBar( mainAxisAlignment: MainAxisAlignment.end, primaryItems: [ CommandBarButton( - icon: const Icon(FluentIcons.add), - label: const Text('添加日程'), + icon: const Icon(FluentIcons.add, color: Colors.white), + label: const Text('添加日程', style: TextStyle(color: Colors.white)), onPressed: () => _addSchedule(null), ), ], @@ -146,27 +146,36 @@ class _SchedulePageState extends State { value: 'week', label: Text( '周视图', - style: TextStyle(fontFamily: 'CustomFont'), + style: TextStyle( + fontFamily: 'CustomFont', + color: Colors.white, + ), ), ), ButtonSegment( value: 'month', label: Text( '月视图', - style: TextStyle(fontFamily: 'CustomFont'), + style: TextStyle( + fontFamily: 'CustomFont', + color: Colors.white, + ), ), ), ButtonSegment( value: 'schedule', label: Text( '日程视图', - style: TextStyle(fontFamily: 'CustomFont'), + style: TextStyle( + fontFamily: 'CustomFont', + color: Colors.white, + ), ), ), ], ), const SizedBox(height: 20), - Expanded(child: _buildSfCalendar()), + Expanded(child: Card(child: _buildSfCalendar())), ], ), ), diff --git a/lib/pages/task_page.dart b/lib/pages/task_page.dart index bc8c4c6..8713480 100644 --- a/lib/pages/task_page.dart +++ b/lib/pages/task_page.dart @@ -123,13 +123,13 @@ class _TaskPageState extends State { Widget build(BuildContext context) { return ScaffoldPage.withPadding( header: PageHeader( - title: const Text('待办任务'), + title: const Text('待办任务', style: TextStyle(color: Colors.white)), commandBar: CommandBar( mainAxisAlignment: MainAxisAlignment.end, primaryItems: [ CommandBarButton( - icon: const Icon(FluentIcons.add), - label: const Text('添加任务'), + icon: const Icon(FluentIcons.add, color: Colors.white), + label: const Text('添加任务', style: TextStyle(color: Colors.white)), onPressed: _addTask, ), ], @@ -155,7 +155,6 @@ class _TaskPageState extends State { final activeCount = _tasks.length - completedCount; return Card( - backgroundColor: FluentTheme.of(context).accentColor.lighter, child: Padding( padding: const EdgeInsets.all(12.0), child: Row( @@ -175,21 +174,16 @@ class _TaskPageState extends State { children: [ Text( value, - style: TextStyle( - fontSize: 24, - fontWeight: FontWeight.bold, - color: Colors.white, - ), + style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold), ), const SizedBox(height: 4), - Text(label, style: TextStyle(color: Colors.white)), + Text(label), ], ); } Widget _buildFilterWidget() { return Card( - borderColor: Colors.white, child: Padding( padding: const EdgeInsets.all(12.0), child: Row( diff --git a/pubspec.yaml b/pubspec.yaml index 197bbd3..76dea49 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1 +1 @@ -name: task_hub description: "待办事项、日程安排" publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: sdk: ^3.10.0 dependencies: flutter: sdk: flutter # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.8 flutter_local_notifications: ^19.5.0 syncfusion_flutter_calendar: ^30.1.37 fluent_ui: ^4.15.0 omni_datetime_picker: ^2.3.1 intl: ^0.20.2 window_size: ^0.1.0 hive: ^2.2.3 hive_flutter: ^1.1.0 timezone: ^0.10.1 dev_dependencies: flutter_test: sdk: flutter hive_generator: ^2.0.1 build_runner: ^2.4.6 flutter_lints: ^5.0.0 msix: ^3.16.13 flutter: uses-material-design: true assets: - assets/icons/ fonts: - family: CustomFont fonts: - asset: fonts/custom.ttf msix_config: display_name: TaskHub publisher_display_name: Cxx identity_name: com.cxx.task msix_version: 1.0.0.0 logo_path: assets/icons/app_icon.ico capabilities: internetClient \ No newline at end of file +name: task_hub description: "待办事项、日程安排" publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.1+1 environment: sdk: ^3.10.0 dependencies: flutter: sdk: flutter # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.8 flutter_local_notifications: ^19.5.0 syncfusion_flutter_calendar: ^30.1.37 fluent_ui: ^4.15.0 omni_datetime_picker: ^2.3.1 intl: ^0.20.2 window_size: ^0.1.0 hive: ^2.2.3 hive_flutter: ^1.1.0 timezone: ^0.10.1 dev_dependencies: flutter_test: sdk: flutter hive_generator: ^2.0.1 build_runner: ^2.4.6 flutter_lints: ^5.0.0 msix: ^3.16.13 flutter: uses-material-design: true assets: - assets/icons/ fonts: - family: CustomFont fonts: - asset: fonts/custom.ttf # dart run msix:create msix_config: display_name: TaskHub publisher_display_name: Cxx identity_name: com.cxx.task msix_version: 1.0.0.1 logo_path: assets/icons/app_icon.ico capabilities: internetClient \ No newline at end of file