refreshRelations static method

Future<ChatModel> refreshRelations(
  1. ChatModel model
)

Implementation

static Future<ChatModel> refreshRelations(ChatModel model) async {
  List<ChatMediumModel>? chatMediaHolder;
  if (model.chatMedia != null) {
    chatMediaHolder = List<ChatMediumModel>.from(
            await Future.wait(model.chatMedia!.map((element) async {
      return await ChatMediumCache.refreshRelations(element);
    })))
        .toList();
  }

  return model.copyWith(
    chatMedia: chatMediaHolder,
  );
}