toFaceLandmarkType function Null safety

FaceLandmarkType? toFaceLandmarkType(
  1. String type
)

Implementation

FaceLandmarkType? toFaceLandmarkType(String type) {
  switch (type) {
    case 'LEFT_EYE':
      return FaceLandmarkType.LEFT_EYE;
    case 'RIGHT_EYE':
      return FaceLandmarkType.RIGHT_EYE;
    case 'LEFT_EAR':
      return FaceLandmarkType.LEFT_EAR;
    case 'RIGHT_EAR':
      return FaceLandmarkType.RIGHT_EAR;
    case 'LEFT_CHEEK':
      return FaceLandmarkType.LEFT_CHEEK;
    case 'RIGHT_CHEEK':
      return FaceLandmarkType.RIGHT_CHEEK;
    case 'NOSE_BASE':
      return FaceLandmarkType.NOSE_BASE;
    case 'MOUTH_LEFT':
      return FaceLandmarkType.MOUTH_LEFT;
    case 'MOUTH_RIGHT':
      return FaceLandmarkType.MOUTH_RIGHT;
    case 'MOUTH_BOTTOM':
      return FaceLandmarkType.MOUTH_BOTTOM;
    default:
      return null;
  }
}