feat:增加日程模块
This commit is contained in:
18
lib/models/Schedule.dart
Normal file
18
lib/models/Schedule.dart
Normal 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();
|
||||
}
|
||||
@@ -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 }
|
||||
Reference in New Issue
Block a user