getNotificationForNote method

Future<List<NotificationModel>> getNotificationForNote (
  1. int id
)

Gets notifications from specific note

Implementation

Future<List<NotificationModel>> getNotificationForNote(int id) async {
  final db = await database;
  List<NotificationModel> notesList = [];
  List<Map> maps = await db.query('Notifications',
      columns: ['_id', 'note', 'date1'], where: "note = ?", whereArgs: [id]);
  if (maps.length > 0) {
    maps.forEach((map) {
      notesList.add(NotificationModel.fromMap(map));
    });
  }
  return notesList;
}