fromEntity static method

Future<AppBarModel?> fromEntity(
  1. String documentID,
  2. AppBarEntity? entity
)

Implementation

static Future<AppBarModel?> fromEntity(
    String documentID, AppBarEntity? entity) async {
  if (entity == null) return null;
  return AppBarModel(
    documentID: documentID,
    appId: entity.appId ?? '',
    title: entity.title,
    header: toHeaderSelection(entity.header),
    icon: await IconModel.fromEntity(entity.icon),
    backgroundOverride:
        await BackgroundModel.fromEntity(entity.backgroundOverride),
    iconColorOverride: await RgbModel.fromEntity(entity.iconColorOverride),
    selectedIconColorOverride:
        await RgbModel.fromEntity(entity.selectedIconColorOverride),
    menuBackgroundColorOverride:
        await RgbModel.fromEntity(entity.menuBackgroundColorOverride),
  );
}