fromJson static method

NexusSurveyQuestion fromJson(
  1. Map<String, dynamic> m
)

Implementation

static NexusSurveyQuestion fromJson(Map<String, dynamic> m) {
  return NexusSurveyQuestion(
    id: '${m['id'] ?? ''}',
    type: '${m['type'] ?? 'open'}',
    label: '${m['label'] ?? ''}',
    description: m['description'] as String?,
    required: m['required'] == true,
    choices:
        (m['choices'] as List?)?.map(NexusSurveyChoice.fromJson).toList() ??
        const [],
    display: m['display'] as String?,
    scaleMin: (m['scaleMin'] as num?)?.toInt(),
    scaleMax: (m['scaleMax'] as num?)?.toInt(),
    lowerLabel: m['lowerLabel'] as String?,
    upperLabel: m['upperLabel'] as String?,
    buttonText: m['buttonText'] as String?,
    buttonUrl: m['buttonUrl'] as String?,
  );
}