fromEntity static method

Future<MenuItemModel?> fromEntity(
  1. String documentID,
  2. MenuItemEntity? entity
)

Implementation

static Future<MenuItemModel?> fromEntity(
    String documentID, MenuItemEntity? entity) async {
  if (entity == null) return null;
  return MenuItemModel(
    documentID: documentID,
    text: entity.text,
    description: entity.description,
    icon: await IconModel.fromEntity(entity.icon),
    action: await ActionModel.fromEntity(entity.action),
  );
}