Skip to content

Reema task-2#4

Open
Reemab27 wants to merge 1 commit intoProgramming-Club-IAU:masterfrom
Reemab27:my-work
Open

Reema task-2#4
Reemab27 wants to merge 1 commit intoProgramming-Club-IAU:masterfrom
Reemab27:my-work

Conversation

@Reemab27
Copy link

@Reemab27 Reemab27 commented Oct 7, 2023

it took me a while to know how to use git..
but i think i understand it now :)

@Reemab27 Reemab27 changed the title done with my task Reema task-2 Oct 7, 2023
Copy link

@Radwan-Albahrani Radwan-Albahrani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall fantastic work. As expected. Here are a couple pointers for code organization and some tips on null safety. Other than that, Task is complete!

Comment on lines +3 to 7
class Task {
String title;

Task(this.title);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend keeping this model in a separate file

case '1':
stdout.write('Add a task: ');
String title = stdin.readLineSync() ?? '';
taskList.addTask(title);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs null checking

Suggested change
taskList.addTask(title);
if(title.isNotEmpty || title.trim() != "")
{
taskList.addTask(title);
}

taskList.viewTasks();
stdout.write('what is the number of the task to update? ');
int updateNum=int.tryParse(stdin.readLineSync() ?? '') ?? -1;
stdout.write('what is the new title? ');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great usage of tryParse

Task(this.title);
}

class TaskListApp {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This in another file as well

Comment on lines +51 to +57
print('\nTask List App Menu:');
print('1. Add Task');
print('2. View Tasks');
print('3. Update Task');
print('4. Delete Task');
print('5. Exit');
stdout.write('Enter your choice (1-6): ');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make this into a separate function called "displayMenu()"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants