valueTransformerDetail function Null safety

String valueTransformerDetail(
  1. EComponentType componentType,
  2. dynamic value
)

Implementation

String valueTransformerDetail(EComponentType componentType, dynamic value) {
  switch (componentType) {
    case EComponentType.INPUT:
    case EComponentType.INPUT_NUMBER:
    case EComponentType.TEXTAREA:
      return (value ?? '').toString();
    case EComponentType.SLIDER:
    case EComponentType.RATE:
      return (value ?? 0).toString();
    default:
      return (value ?? '').toString();
  }
}