getVerticalAlignmentType static method

VerticalAlignmentType? getVerticalAlignmentType(
  1. String? alignment, {
  2. VerticalAlignmentType? defaultType,
})

Implementation

static VerticalAlignmentType? getVerticalAlignmentType(String? alignment, {VerticalAlignmentType? defaultType})
{
  switch (alignment?.toLowerCase().trim())
  {
    case 'top':
    case 'start':
      return VerticalAlignmentType.top;

    case 'bottom':
    case 'end':
      return VerticalAlignmentType.bottom;

    case 'center':
      return VerticalAlignmentType.center;

    case 'spacearound':
    case 'around':
      return VerticalAlignmentType.around;

    case 'spacebetween':
    case 'between':
      return VerticalAlignmentType.between;

    case 'spaceevenly':
    case 'evenly':
      return VerticalAlignmentType.evenly;

    default: return defaultType;
  }
}