typeToValue function

String typeToValue(
  1. String fieldType
)

Implementation

String typeToValue(String fieldType) {
  String response;
  switch (fieldType) {
    case 'int':
    case 'double':
    case 'bool':
      response = 'value.toString()';
      break;
    case 'DateTime':
      response = 'value.toIso8601String()';
      break;
    default:
      response = 'value';
  }
  return response;
}