refreshRelations static method
Implementation
static Future<FeedMenuModel> refreshRelations(FeedMenuModel model) async {
FeedFrontModel? feedFrontHolder;
if (model.feedFront != null) {
try {
await feedFrontRepository(appId: model.appId)!
.get(model.feedFront!.documentID)
.then((val) {
feedFrontHolder = val;
}).catchError((error) {});
} catch (_) {}
}
List<LabelledBodyComponentModel>? bodyComponentsCurrentMemberHolder;
if (model.bodyComponentsCurrentMember != null) {
bodyComponentsCurrentMemberHolder = List<LabelledBodyComponentModel>.from(
await Future.wait(
model.bodyComponentsCurrentMember!.map((element) async {
return await LabelledBodyComponentCache.refreshRelations(element);
})))
.toList();
}
List<LabelledBodyComponentModel>? bodyComponentsOtherMemberHolder;
if (model.bodyComponentsOtherMember != null) {
bodyComponentsOtherMemberHolder = List<LabelledBodyComponentModel>.from(
await Future.wait(
model.bodyComponentsOtherMember!.map((element) async {
return await LabelledBodyComponentCache.refreshRelations(element);
})))
.toList();
}
return model.copyWith(
feedFront: feedFrontHolder,
bodyComponentsCurrentMember: bodyComponentsCurrentMemberHolder,
bodyComponentsOtherMember: bodyComponentsOtherMemberHolder,
);
}