task.dart 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import 'package:flutter/foundation.dart';
  2. enum TaskStatus { recording, pending, scheduled, completed, failed }
  3. @immutable
  4. final class Task {
  5. const Task({
  6. required this.id,
  7. required this.title,
  8. required this.project,
  9. required this.status,
  10. this.progress,
  11. this.recordedCount,
  12. this.totalCount,
  13. this.footNote,
  14. this.timeInfo,
  15. });
  16. final String id;
  17. final String title;
  18. final String project;
  19. final TaskStatus status;
  20. final double? progress;
  21. final int? recordedCount;
  22. final int? totalCount;
  23. final String? footNote;
  24. final String? timeInfo;
  25. Task copyWith({
  26. String? id,
  27. String? title,
  28. String? project,
  29. TaskStatus? status,
  30. double? progress,
  31. int? recordedCount,
  32. int? totalCount,
  33. String? footNote,
  34. String? timeInfo,
  35. }) {
  36. return Task(
  37. id: id ?? this.id,
  38. title: title ?? this.title,
  39. project: project ?? this.project,
  40. status: status ?? this.status,
  41. progress: progress ?? this.progress,
  42. recordedCount: recordedCount ?? this.recordedCount,
  43. totalCount: totalCount ?? this.totalCount,
  44. footNote: footNote ?? this.footNote,
  45. timeInfo: timeInfo ?? this.timeInfo,
  46. );
  47. }
  48. }
  49. @immutable
  50. final class TaskSection {
  51. const TaskSection({required this.title, required this.tasks, this.action});
  52. final String title;
  53. final List<Task> tasks;
  54. final String? action;
  55. }