Skip to content

Habib Al-Shaikh - Selection-Project#10

Open
HabibAlShaikh wants to merge 7 commits intoGDSC-IAU:masterfrom
HabibAlShaikh:master
Open

Habib Al-Shaikh - Selection-Project#10
HabibAlShaikh wants to merge 7 commits intoGDSC-IAU:masterfrom
HabibAlShaikh:master

Conversation

@HabibAlShaikh
Copy link

No description provided.

Copy link
Contributor

@RyamAlmalki RyamAlmalki left a comment

Choose a reason for hiding this comment

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

I was happy when you added the check to see if the title name was already taken! I love that you thought about it and also created a cute interface. I had a fun time using it. So proud of you!! Can't wait to see more of your beautiful work.

return;
}
}
class NoteList{
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider separating classes into different files for improved readability.

notes.deleteNoteByTitle(foundNote.title);
print(greenColor + "Note with Title \"${foundNote.title}\" found deleted successfully." + resetColor);
} else {
print(redColor + "Note not found." + resetColor);
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of using global variables for colors, consider using a helper function to apply colors when printing messages. This can make your code more modular and easier to maintain.

String applyColor(String message, String color) {
  return '$color$message$resetColor';
}

// Usage
print(applyColor("Invalid choice.", redColor));

int searchBy = int.parse(input!);
switch(searchBy){
case 1:
print("enter ID: ");
Copy link
Contributor

Choose a reason for hiding this comment

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

There is some duplication in the code, particularly in the editNote, deleteNote, and searchNote functions. Consider refactoring the common parts into separate functions to avoid redundancy, such as searching for a note by ID.

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