updateNote method

Future<int> updateNote(
  1. Note oldNote,
  2. Note newNote
)

Implementation

Future<int> updateNote(Note oldNote, Note newNote) async {
  final db = await createDatabase;
  return await db.update(
    'Note',
    {'title': newNote.title, 'body': newNote.body},
    where: 'id = ?',
    whereArgs: [oldNote.id],
  );
}