vandadnp / mynotes-course

This is the GitHub repository of the MyNotes application for the Free Flutter Course (https://www.youtube.com/playlist?list=PL6yRaaP0WPkVtoeNIGqILtRAgd3h2CNpT)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug on update.

abondar24 opened this issue · comments

I have just found a tiny bug in updateNote function in notes_service. If you add a note and close the app, after restart you will see that the text of all your notes will be the same and equal to the value of the last note. Hot restart also reproduces this behaviour.

The actual fix is to add id of note to a update query. Please see a snippet below

final updCount = await db.update(noteTable, where: 'id =?', whereArgs: [ id ], { textCol: text, });