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, dynamic> data = {
      "interpretationType": value,
      "interpretationExtraComments": comments,
    };

    _db.updateDocument(
      databaseId: AppConstants.appwriteDatabaseId,
      collectionId: 'tests',
      documentId: widget.test.id!,
      data: data,
    );

    setState(() {
      test!.interpretationType = value;
      test!.interpretationExtraComments = comments;
      radioValue = value;
    });
  } else {
    setState(() {
      radioValue = null;
    });
  }
}