feat:增加主题色
This commit is contained in:
@@ -36,12 +36,12 @@ class TaskItem extends StatelessWidget {
|
||||
children: [
|
||||
_buildPriorityIndicator(task.priority),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(child: _buildTitle()),
|
||||
Expanded(child: _buildTitle(context)),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
const SizedBox(height: 4),
|
||||
if (task.desc != null && task.desc!.isNotEmpty) _buildDesc(),
|
||||
const SizedBox(height: 2),
|
||||
const SizedBox(height: 4),
|
||||
if (task.dueDate != null || task.scheduleDate != null)
|
||||
_buildDate(),
|
||||
],
|
||||
@@ -62,14 +62,14 @@ class TaskItem extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildTitle() {
|
||||
Widget _buildTitle(BuildContext context) {
|
||||
return Text(
|
||||
task.title,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontWeight: FontWeight.bold,
|
||||
decoration: task.isCompleted ? TextDecoration.lineThrough : null,
|
||||
color: task.isCompleted ? Colors.grey : Colors.red,
|
||||
color: task.isCompleted ? Colors.grey[100] : FluentTheme.of(context).accentColor,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -78,7 +78,7 @@ class TaskItem extends StatelessWidget {
|
||||
return Text(
|
||||
task.desc!,
|
||||
style: TextStyle(
|
||||
color: Colors.grey,
|
||||
color: Colors.grey[150],
|
||||
fontSize: 14,
|
||||
decoration: task.isCompleted ? TextDecoration.lineThrough : null,
|
||||
),
|
||||
@@ -89,20 +89,20 @@ class TaskItem extends StatelessWidget {
|
||||
return Row(
|
||||
children: [
|
||||
if (task.dueDate != null) ...[
|
||||
const Icon(FluentIcons.calendar, size: 12, color: Colors.grey),
|
||||
Icon(FluentIcons.calendar, size: 12, color: Colors.grey),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
'截止日期: ${_formatDate(task.dueDate!)}',
|
||||
style: const TextStyle(color: Colors.grey, fontSize: 12),
|
||||
style: TextStyle(color: Colors.grey, fontSize: 12),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
],
|
||||
if (task.scheduleDate != null) ...[
|
||||
const Icon(FluentIcons.clock, size: 12, color: Colors.grey),
|
||||
Icon(FluentIcons.clock, size: 12, color: Colors.grey),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
'提醒日期: ${_formatDate(task.scheduleDate!)}',
|
||||
style: const TextStyle(color: Colors.grey, fontSize: 12),
|
||||
style: TextStyle(color: Colors.grey, fontSize: 12),
|
||||
),
|
||||
],
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user