Skip to content

Zahra Alnamer#1

Open
ZahraHN-03 wants to merge 8 commits intoProgramming-Club-IAU:masterfrom
ZahraHN-03:feature
Open

Zahra Alnamer#1
ZahraHN-03 wants to merge 8 commits intoProgramming-Club-IAU:masterfrom
ZahraHN-03:feature

Conversation

@ZahraHN-03
Copy link

No description provided.

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.

Fantastic work. Very proud of you. Here are some comments for best practices but You have completed the task! Well done!

import 'taskList.dart';

//you can make it global so you can access it from anywhere
List<Task> _tasks = [];

Choose a reason for hiding this comment

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

this variable is not necessary anymore

Suggested change
List<Task> _tasks = [];

Comment on lines +7 to +9
Task operator [](int taskID) {
return _tasks[taskID];
}

Choose a reason for hiding this comment

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

smart way to add an operator to the taskList. Didnt even know that was possible 😂

if (taskID <= tasks.length && taskID > 0) {
stdout.write("Enter Your New Title:");
String? Title = stdin.readLineSync();
tasks[taskID].title = Title!;

Choose a reason for hiding this comment

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

while this method is smart, it allows for direct access to the task attributes without any security measures. Its why i recommended adding, updating, and removing directly from inside the TaskList class. This would ensure all the data preprocessing you will do including null checking and stuff happens before the title is changed

class TaskListApp {
// TODO: Implement Task list app
//For Description Update
void updateDescription(_tasks) {

Choose a reason for hiding this comment

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

unnecessary variable

Suggested change
void updateDescription(_tasks) {
void updateDescription() {

}

//For Title Update
void updateTitle(_tasks) {

Choose a reason for hiding this comment

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

unnecessary variable

Suggested change
void updateTitle(_tasks) {
void updateTitle() {

}
switch (choice) {
case 1:
updateTitle(_tasks);

Choose a reason for hiding this comment

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

unnecessary variable

Suggested change
updateTitle(_tasks);
updateTitle();

or if you move it to the TaskList Class

Suggested change
updateTitle(_tasks);
tasks.updateTitle();

updateTitle(_tasks);
break;
case 2:
updateDescription(_tasks);

Choose a reason for hiding this comment

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

unnecessary variable

Suggested change
updateDescription(_tasks);
updateDescription();

void choose() {
int choice = 0;
try {
stdout.write("To Change Title:1 / To Change Description:2 \n Your Choice?");

Choose a reason for hiding this comment

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

Could make this prettier

Suggested change
stdout.write("To Change Title:1 / To Change Description:2 \n Your Choice?");
stdout.write("1. Change Title\n2. Change Description\n Your Choice: ");

bool validChoice = false;
while (!validChoice) {
try {
stdout.write("Your Choice?");

Choose a reason for hiding this comment

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

could make this prettier

Suggested change
stdout.write("Your Choice?");
stdout.write("Your Choice: ");

@ZahraHN-03 ZahraHN-03 changed the title Feature Zahra Alnamer Oct 12, 2023
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