Skip to content

Zahra Al Eid - Selection Project#1

Open
ZahraAleid wants to merge 9 commits intoGDSC-IAU:masterfrom
ZahraAleid:master
Open

Zahra Al Eid - Selection Project#1
ZahraAleid wants to merge 9 commits intoGDSC-IAU:masterfrom
ZahraAleid:master

Conversation

@ZahraAleid
Copy link

No description provided.

@ZahraAleid
Copy link
Author

Screenshot 2024-01-31 211710
Screenshot 2024-01-31 211724
Screenshot 2024-01-31 211738
Screenshot 2024-01-31 211748
Screenshot 2024-01-31 211758

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.

Overall, good job Zahra!



default:
exit;
Copy link
Contributor

Choose a reason for hiding this comment

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

use break to exit the loop and let the loop condition handle the exit.


}

static void editTitleM(String? toEdit ,String? editNoteV){
Copy link
Contributor

Choose a reason for hiding this comment

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

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 {
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 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() {
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 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;
Copy link
Contributor

Choose a reason for hiding this comment

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

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 =[];
Copy link
Contributor

Choose a reason for hiding this comment

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

uses camelCase
notesList

String? newNoteContent;

print("Title: \n ****");
newNoteTitle = stdin.readLineSync();
Copy link
Contributor

Choose a reason for hiding this comment

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

check if the title already exists before adding the note or if the title is empty.

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