feat:增加日程模块

This commit is contained in:
2026-04-26 14:23:32 +08:00
parent 57c6e552d4
commit 8f6e4cc23e
13 changed files with 905 additions and 518 deletions

18
lib/models/Schedule.dart Normal file
View File

@@ -0,0 +1,18 @@
class Schedule {
final int id;
String title;
DateTime startTime;
DateTime endTime;
DateTime? scheduleDate;
DateTime createTime;
Schedule({
int? id,
required this.title,
required this.startTime,
required this.endTime,
this.scheduleDate,
DateTime? createTime,
}) : id = id ?? DateTime.timestamp().microsecond,
createTime = DateTime.now();
}

View File

@@ -1,24 +1,26 @@
class Task {
final String id;
final int id;
String title;
String? description;
DateTime createdAt;
String? desc;
DateTime? dueDate;
DateTime? scheduleDate;
bool isCompleted;
Priority priority;
String? category;
DateTime createTime;
Task({
String? id,
int? id,
required this.title,
this.description,
DateTime? createdAt,
this.desc,
this.dueDate,
this.scheduleDate,
this.isCompleted = false,
this.priority = Priority.medium,
this.category,
}) : id = id ?? DateTime.timestamp().microsecond.toString(),
createdAt = createdAt ?? DateTime.now();
DateTime? createTime,
}) : id = id ?? DateTime.timestamp().microsecond,
createTime = DateTime.now();
}
enum Priority { low, medium, high }