taima aldossary - selection project#6
taima aldossary - selection project#6taima-aldossary wants to merge 1 commit intoGDSC-IAU:masterfrom
Conversation
RyamAlmalki
left a comment
There was a problem hiding this comment.
Overall, good job! Really proud of you. I can see the work and effort you have put in, and it's amazing. Don't take this as discouragement; there is always room for improvement. Take this as a challenge for next time to get better and better.
| print('Note added successfully!'); | ||
| } | ||
|
|
||
| void searchNote() { |
There was a problem hiding this comment.
This error has occurred from this given function.

First, let's take a look at how this error was produced.
3.Now The user decides to delete the first note, but they didn't write the note name correct.

An error has occurred, as you can observe.
Now, why did this error occur?
3.Now The user decides to delete the first note, but they didn't write the note name correct.



| } | ||
| } | ||
|
|
||
| void addNote() { |
| } | ||
| } | ||
|
|
||
| void editNote() { |
There was a problem hiding this comment.
Analyzing Logical Errors
Creating 2 Notes
Searching for a Note
Editing a Note with a Wrong Name
-
A logical error occurred while editing a note. Accidentally, the wrong name was entered, leading to unexpected behavior:

- Noteworthy: The system prompted for a title even with the wrong name.
Unintended Note Edit
- Upon reviewing my notes, a startling observation was made— a note was edited without specific user request:

All of these issues can be attributed to the use of index=-1. This global value requires careful handling in each function to avoid unintended consequences. It serves as a reminder to exercise caution when utilizing global variables across functions in your code.
|
|
||
| import '../models/note_model.dart'; | ||
|
|
||
| class NoteApp { |
There was a problem hiding this comment.
It would have been a better option to separate this class more for readability. One that handles the menu operations and another that handles note app functionality, such as add/delete operations
| print('Enter the note title: '); | ||
| title = stdin.readLineSync()!; | ||
|
|
||
| if (title == null || title.trim().isEmpty) { |
There was a problem hiding this comment.
!: The null assertion operator. It is used to assert that the value to its left is non-null. It essentially tells the Dart analyzer that you are confident the value won't be null at runtime.
so having title == null is not needed since it will not be null













I have implemented a user-friendly menu offering various options such as adding, editing, deleting, searching, and viewing notes. Also, there is a method for each option in the menu. The search method is employed within both the edit and delete methods to enhance code reusability.