2024-09-23 15:47:27 +04:00
|
|
|
import 'task.dart';
|
|
|
|
|
|
|
|
class TaskManager {
|
|
|
|
final List<Task> _tasks = [];
|
|
|
|
|
|
|
|
void addTask(Task task) {
|
|
|
|
_tasks.add(task);
|
|
|
|
}
|
|
|
|
|
|
|
|
List<Task> getTasks() {
|
|
|
|
return _tasks;
|
|
|
|
}
|
|
|
|
|
2024-10-02 10:47:19 +04:00
|
|
|
Future<void> simulateTaskProcessing(Task task) async {
|
2024-09-23 15:47:27 +04:00
|
|
|
await Future.delayed(const Duration(seconds: 2));
|
2024-10-02 10:47:19 +04:00
|
|
|
|
|
|
|
print('Задание ${task.title} выполнено');
|
2024-09-23 15:47:27 +04:00
|
|
|
}
|
|
|
|
}
|