feat:更新待办事项对话框功能

This commit is contained in:
2025-11-07 14:33:26 +08:00
parent d7ce7d644a
commit 0f106f6adc
19 changed files with 626 additions and 700 deletions

View File

@@ -1,45 +1,48 @@
import 'package:flutter/material.dart';
class TodoItem {
String id;
num id;
String title;
String? description;
String content;
bool isCompleted;
DateTime createdAt;
DateTime? dueDate;
TodoPriority priority;
String? category;
TodoItem({
required this.id,
required this.title,
this.description,
required this.content,
this.isCompleted = false,
DateTime? createdAt,
this.dueDate,
this.priority = TodoPriority.medium,
this.category,
}) : createdAt = createdAt ?? DateTime.now();
});
TodoItem copyWith({
String? id,
num? id,
String? title,
String? description,
String? content,
bool? isCompleted,
DateTime? createdAt,
DateTime? dueDate,
TodoPriority? priority,
String? category,
}) {
return TodoItem(
id: id ?? this.id,
title: title ?? this.title,
description: description ?? this.description,
content: content ?? this.content,
isCompleted: isCompleted ?? this.isCompleted,
createdAt: createdAt ?? this.createdAt,
dueDate: dueDate ?? this.dueDate,
priority: priority ?? this.priority,
category: category ?? this.category,
);
}
static TodoItem getEmpty() {
return TodoItem(
id: 0,
title: '',
content: '',
isCompleted: false,
dueDate: null,
priority: TodoPriority.medium,
);
}
}