fromEntity static method

Future<PosSizeModel?> fromEntity(
  1. PosSizeEntity? entity
)

Implementation

static Future<PosSizeModel?> fromEntity(PosSizeEntity? entity) async {
  if (entity == null) return null;
  return PosSizeModel(
    widthPortrait: entity.widthPortrait,
    widthTypePortrait: toWidthTypePortrait(entity.widthTypePortrait),
    widthLandscape: entity.widthLandscape,
    widthTypeLandscape: toWidthTypeLandscape(entity.widthTypeLandscape),
    heightPortrait: entity.heightPortrait,
    heightTypePortrait: toHeightTypePortrait(entity.heightTypePortrait),
    heightLandscape: entity.heightLandscape,
    heightTypeLandscape: toHeightTypeLandscape(entity.heightTypeLandscape),
    fitPortrait: toPortraitFitType(entity.fitPortrait),
    fitLandscape: toLandscapeFitType(entity.fitLandscape),
    alignTypePortrait: toPortraitAlignType(entity.alignTypePortrait),
    alignTypeLandscape: toLandscapeAlignType(entity.alignTypeLandscape),
    clip: toClipType(entity.clip),
  );
}