fromEntity static method

Future<DrawerModel?> fromEntity(
  1. String documentID,
  2. DrawerEntity? entity
)

Implementation

static Future<DrawerModel?> fromEntity(
    String documentID, DrawerEntity? entity) async {
  if (entity == null) return null;
  return DrawerModel(
    documentID: documentID,
    appId: entity.appId ?? '',
    name: entity.name,
    backgroundOverride:
        await BackgroundModel.fromEntity(entity.backgroundOverride),
    headerText: entity.headerText,
    secondHeaderText: entity.secondHeaderText,
    headerHeight: entity.headerHeight,
    popupMenuBackgroundColor:
        await RgbModel.fromEntity(entity.popupMenuBackgroundColor),
    headerBackgroundOverride:
        await BackgroundModel.fromEntity(entity.headerBackgroundOverride),
    popupMenuBackgroundColorOverride:
        await RgbModel.fromEntity(entity.popupMenuBackgroundColorOverride),
  );
}