addNotificationInDB method

Future<NotificationModel> addNotificationInDB (
  1. NotificationModel newNote
)

Adds notification in database

Implementation

Future<NotificationModel> addNotificationInDB(
    NotificationModel newNote) async {
  final db = await database;
  int id = await db.transaction((transaction) {
    return transaction.rawInsert(
        'INSERT into Notifications(note, date1) VALUES ( "${newNote.note}", "${newNote.date1}");');
  });
  newNote.id = id;
  print('Notification added: ${newNote.date1}');
  return newNote;
}