feat:更新主题色兼容
This commit is contained in:
@@ -3,10 +3,15 @@ import 'package:flisp_app/utils/theme_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class AppDrawer extends StatelessWidget {
|
||||
class AppDrawer extends StatefulWidget {
|
||||
const AppDrawer({super.key});
|
||||
|
||||
DrawerHeader _buildDrawerHeader(BuildContext context) {
|
||||
@override
|
||||
State<AppDrawer> createState() => AppDrawerState();
|
||||
}
|
||||
|
||||
class AppDrawerState extends State<AppDrawer> {
|
||||
DrawerHeader _buildDrawerHeader() {
|
||||
return DrawerHeader(
|
||||
decoration: BoxDecoration(color: Theme.of(context).colorScheme.primary),
|
||||
child: Column(
|
||||
@@ -39,7 +44,7 @@ class AppDrawer extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildDarkModeSection(BuildContext context, AppProvider appProvider) {
|
||||
Widget _buildDarkModeSection(AppProvider appProvider) {
|
||||
return ListTile(
|
||||
leading: Icon(
|
||||
appProvider.isDarkMode ? Icons.dark_mode : Icons.light_mode,
|
||||
@@ -58,7 +63,7 @@ class AppDrawer extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildThemeSection(BuildContext context, AppProvider appProvider) {
|
||||
Widget _buildThemeSection(AppProvider appProvider) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -66,7 +71,7 @@ class AppDrawer extends StatelessWidget {
|
||||
padding: const EdgeInsets.fromLTRB(16, 16, 16, 8),
|
||||
child: Text('主题颜色', style: Theme.of(context).textTheme.titleMedium),
|
||||
),
|
||||
_buildDarkModeSection(context, appProvider),
|
||||
_buildDarkModeSection(appProvider),
|
||||
buildThemeColorList(context, appProvider),
|
||||
],
|
||||
);
|
||||
@@ -74,7 +79,6 @@ class AppDrawer extends StatelessWidget {
|
||||
|
||||
// 构建抽屉菜单项
|
||||
Widget _buildDrawerItem({
|
||||
required BuildContext context,
|
||||
required IconData icon,
|
||||
required String title,
|
||||
required VoidCallback onTap,
|
||||
@@ -118,11 +122,10 @@ class AppDrawer extends StatelessWidget {
|
||||
child: ListView(
|
||||
padding: EdgeInsets.zero,
|
||||
children: [
|
||||
_buildDrawerHeader(context),
|
||||
_buildThemeSection(context, appProvider),
|
||||
_buildDrawerHeader(),
|
||||
_buildThemeSection(appProvider),
|
||||
const Divider(),
|
||||
_buildDrawerItem(
|
||||
context: context,
|
||||
icon: Icons.help,
|
||||
title: '帮助与反馈',
|
||||
onTap: () {
|
||||
@@ -136,7 +139,7 @@ class AppDrawer extends StatelessWidget {
|
||||
_buildVersionInfo(
|
||||
context: context,
|
||||
fullVersion: appProvider.fullVersion,
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -42,7 +42,11 @@ class _MainScreenState extends State<MainScreen> {
|
||||
TodoSortMode.priority,
|
||||
);
|
||||
final List<Todo> todayTodos =
|
||||
todoResult.where((todo) => isToday(todo.scheduledTime)).toList();
|
||||
todoResult
|
||||
.where(
|
||||
(todo) => !todo.isCompleted && isAfterToday(todo.scheduledTime),
|
||||
)
|
||||
.toList();
|
||||
|
||||
for (Todo todo in todayTodos) {
|
||||
await notifyService.scheduleNotification(
|
||||
@@ -57,7 +61,7 @@ class _MainScreenState extends State<MainScreen> {
|
||||
final List<Calendar> calendarResult = calendarService.getAllCalendars();
|
||||
final List<Calendar> todayCalendars =
|
||||
calendarResult
|
||||
.where((calendar) => isToday(calendar.scheduledTime))
|
||||
.where((item) => isAfterToday(item.scheduledTime))
|
||||
.toList();
|
||||
|
||||
for (Calendar calendar in todayCalendars) {
|
||||
|
||||
Reference in New Issue
Block a user