saveStudy method

Future<bool> saveStudy(
  1. SmartphoneStudy study
)

Saves study, replacing any existing row for it. Returns true if successful.

Implementation

Future<bool> saveStudy(SmartphoneStudy study) async {
  bool success = true;
  try {
    await _database?.insert(STUDY_TABLE_NAME, _getMap(study), conflictAlgorithm: ConflictAlgorithm.replace);
    debug('$runtimeType - Inserted study - $study');
  } catch (exception) {
    success = false;
    warning('$runtimeType - Failed to save study - $exception');
  }
  return success;
}