-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.dart
40 lines (39 loc) · 862 Bytes
/
main.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// import 'task.dart';
import 'taskManager.dart';
import 'dart:io';
void main() {
print("""
Type 1 to add new tasks\n
Type 2 to view all tasks\n
Type 3 to view completed tasks\n
Type 4 to view pending tasks\n
Type 5 to edit task\n
Type 6 to exit\n
""");
while (true) {
String? input = stdin.readLineSync();
int n = int.parse(input!);
switch (n) {
case 1:
TaskManager.addNewTask();
break;
case 2:
TaskManager.viewAllTasks();
break;
case 3:
TaskManager.viewCompletedTasks();
break;
case 4:
TaskManager.viewPendingTasks();
break;
case 5:
TaskManager.editTask();
break;
case 6:
exit(0);
default:
print('Invalid input. Please enter a number between 1 and 6.');
break;
}
}
}