toFaceContourType function Null safety

FaceContourType? toFaceContourType(
  1. String type
)

Implementation

FaceContourType? toFaceContourType(String type) {
  switch (type) {
    case 'FACE':
      return FaceContourType.FACE;
    case 'LEFT_EYE':
      return FaceContourType.LEFT_EYE;
    case 'RIGHT_EYE':
      return FaceContourType.RIGHT_EYE;
    case 'LEFT_EYEBROW_TOP':
      return FaceContourType.LEFT_EYEBROW_TOP;
    case 'LEFT_EYEBROW_BOTTOM':
      return FaceContourType.LEFT_EYEBROW_BOTTOM;
    case 'RIGHT_EYEBROW_TOP':
      return FaceContourType.RIGHT_EYEBROW_TOP;
    case 'RIGHT_EYEBROW_BOTTOM':
      return FaceContourType.RIGHT_EYEBROW_BOTTOM;
    case 'NOSE_BRIDGE':
      return FaceContourType.NOSE_BRIDGE;
    case 'NOSE_BOTTOM':
      return FaceContourType.NOSE_BOTTOM;
    case 'LEFT_CHEEK':
      return FaceContourType.LEFT_CHEEK;
    case 'RIGHT_CHEEK':
      return FaceContourType.RIGHT_CHEEK;
    case 'UPPER_LIP_TOP':
      return FaceContourType.UPPER_LIP_TOP;
    case 'UPPER_LIP_BOTTOM':
      return FaceContourType.UPPER_LIP_BOTTOM;
    case 'LOWER_LIP_TOP':
      return FaceContourType.LOWER_LIP_TOP;
    case 'LOWER_LIP_BOTTOM':
      return FaceContourType.LOWER_LIP_BOTTOM;
    default:
      return null;
  }
}