updateFileId static method

dynamic updateFileId(
  1. String? id,
  2. int index,
  3. int idList
)

Implementation

static updateFileId(String? id, int index, int idList) async {
  try {
    List<PersonChat> getChats = chat.where((element) => element.id == index).toList();
    if (getChats.isNotEmpty) {
      getChats.first.chatType.idFile = id;
    }
  } catch (_) {
    print(_);
  }
  await ChatDatabase.updateIdFile(
    id: id,
    index: index,
    idList: idList,
  );
}