refreshRelations static method

Future<MenuDefModel> refreshRelations(
  1. MenuDefModel model
)

Implementation

static Future<MenuDefModel> refreshRelations(MenuDefModel model) async {
  List<MenuItemModel>? menuItemsHolder;
  if (model.menuItems != null) {
    menuItemsHolder = List<MenuItemModel>.from(
            await Future.wait(model.menuItems!.map((element) async {
      return await MenuItemCache.refreshRelations(element);
    })))
        .toList();
  }

  return model.copyWith(
    menuItems: menuItemsHolder,
  );
}