createAndSendResult method

  1. @override
void createAndSendResult()
override

This method should be implemented in all the Widgets which are producing an RPResult object.

Implementation

@override
createAndSendResult() {
  // Populate the result object with value and end the time tracker (set endDate)
  _taskResult?.endDate = DateTime.now();
  RPTaskResult? translatedTaskResult;
  if (RPLocalizations.of(context) != null && _taskResult != null) {
    translatedTaskResult =
        _translateTaskResult(RPLocalizations.of(context)!, _taskResult!);
  }
  widget.onSubmit?.call(translatedTaskResult ?? _taskResult!);
}