fromEntity static method

Future<HomeMenuModel?> fromEntity(
  1. String documentID,
  2. HomeMenuEntity? entity
)

Implementation

static Future<HomeMenuModel?> fromEntity(
    String documentID, HomeMenuEntity? entity) async {
  if (entity == null) return null;
  return HomeMenuModel(
    documentID: documentID,
    appId: entity.appId ?? '',
    name: entity.name,
    iconColorOverride: await RgbModel.fromEntity(entity.iconColorOverride),
    backgroundOverride:
        await BackgroundModel.fromEntity(entity.backgroundOverride),
    popupMenuBackgroundColorOverride:
        await RgbModel.fromEntity(entity.popupMenuBackgroundColorOverride),
  );
}