updateCallback method

void updateCallback(
  1. String value,
  2. String comments,
  3. bool update
)

Implementation

void updateCallback(String value, String comments, bool update) {
  if (update) {
    Map<String, String> data = {};
    data["interpretationType"] = value;
    data["interpretationExtraComments"] = comments;

    final updatedTest = state.test;
    updatedTest.interpretationType = value;
    updatedTest.interpretationExtraComments = comments;

    emit(state.copyWith(
      test: updatedTest,
      radioValue: value,
    ));
  } else {
    emit(state.copyWith(
      radioValue: null,
    ));
  }
}