refreshRelations static method
Implementation
static Future<AppBarModel> refreshRelations(AppBarModel model) async {
MemberMediumModel? imageHolder;
if (model.image != null) {
try {
await memberMediumRepository(appId: model.appId)!
.get(model.image!.documentID)
.then((val) {
imageHolder = val;
}).catchError((error) {});
} catch (_) {}
}
MenuDefModel? iconMenuHolder;
if (model.iconMenu != null) {
try {
await menuDefRepository(appId: model.appId)!
.get(model.iconMenu!.documentID)
.then((val) {
iconMenuHolder = val;
}).catchError((error) {});
} catch (_) {}
}
return model.copyWith(
image: imageHolder,
iconMenu: iconMenuHolder,
);
}