Conversation
…rccorenote_app.dart
RyamAlmalki
left a comment
There was a problem hiding this comment.
Overall, good job Zahra!
|
|
||
|
|
||
| default: | ||
| exit; |
There was a problem hiding this comment.
use break to exit the loop and let the loop condition handle the exit.
|
|
||
| } | ||
|
|
||
| static void editTitleM(String? toEdit ,String? editNoteV){ |
There was a problem hiding this comment.
The methods editTitleM and editContentM have similar logic. You could consider refactoring the common logic into a method to avoid code duplication.
| @@ -0,0 +1,128 @@ | |||
| import 'note_app.dart'; | |||
| class Note { | |||
There was a problem hiding this comment.
Consider separating the note title and content into the note_model.dart file, and place note functions in a NoteManager class for better readability.
| class NoteApp { | ||
| // TODO: Complete the run function | ||
|
|
||
| void run() { |
There was a problem hiding this comment.
Consider separating different functionalities into separate methods.
if (operation > 0 && operation < 7) {
switch (operation) {
case 1:
createNote();
break;
case 2:
editNote();
break;
case 3:
deleteNote();
break;
case 4:
printNotes();
break;
case 5:
searchNote();
break;
case 6:
print("Exiting Note Taking App.");
break;
default:
print("Invalid choice. Please enter a number between 1 to 6.");
break;
}
} else {
print("Invalid choice. Please enter a number between 1 to 6.");
}
} while (operation != 6);
| import 'note_app.dart'; | ||
| class Note { | ||
|
|
||
| String? Title, Content; |
There was a problem hiding this comment.
consider using non-nullable types for your class properties if possible. This can help catch potential null-related errors during development.
String title;
String content;
Note.create({required this.title, required this.content});
| return Content; | ||
| } | ||
|
|
||
| static List<Note> NotesList =[]; |
There was a problem hiding this comment.
uses camelCase
notesList
| String? newNoteContent; | ||
|
|
||
| print("Title: \n ****"); | ||
| newNoteTitle = stdin.readLineSync(); |
There was a problem hiding this comment.
check if the title already exists before adding the note or if the title is empty.





No description provided.