resolveValue method
Implementation
Widget resolveValue({required QuizQuestionModel question, required dynamic value}) {
if (question.type == 'boolean') {
return Text(
getBoolean(value),
textAlign: TextAlign.right,
style: const TextStyle(fontWeight: FontWeight.bold),
);
}
if (question.type == 'scale') {
return Text(
'${value['value'] ?? '-'}/${value['max'] ?? '5'}',
textAlign: TextAlign.right,
style: const TextStyle(fontWeight: FontWeight.bold),
);
}
if (question.type == 'date') {
return Text(
getDate(value),
textAlign: TextAlign.right,
style: const TextStyle(fontWeight: FontWeight.bold),
);
}
if (question.useQuizOptionModelToFormatAnswer) {
return Text(
getQuizOptionValue(question, value),
textAlign: TextAlign.right,
style: const TextStyle(fontWeight: FontWeight.bold),
);
}
return Text(
value.toString(),
textAlign: TextAlign.right,
style: const TextStyle(fontWeight: FontWeight.bold),
);
}