exec method

Future<String> exec()

新しいリハビリテーションを開始する。

新しいリハビリテーションを開始し、そのIDを返します。

Return: Future<String> が返されます。このFutureは、新しいリハビリテーションのIDを完了時に返します。

使用するリポジトリ:

  • RehabilitationRepository : リハビリテーションのデータ操作を管理するリポジトリ 使用するAPI:
  • RehabilitationApi.startRehabilitation : 新しいリハビリテーションを開始するAPI

Implementation

Future<String> exec() async {
  try {
    final rehabilitationId =
        await _rehabilitationRepository.startRehabilitation();
    return rehabilitationId;
  } on RepositoryException catch (error, stackTrace) {
    throw _errorHandler.handleRepositoryError(error, stackTrace);
  } catch (error, stackTrace) {
    throw _errorHandler.handleUnknownError(error, stackTrace);
  }
}