getStudyProtocol method
Get a SmartphoneStudyProtocol based on its id
.
Returns null
if no protocol exists.
Implementation
@override
Future<SmartphoneStudyProtocol?> getStudyProtocol(String studyId) async {
info("Loading study '$studyId'.");
SmartphoneStudyProtocol? study;
try {
String jsonString = File(filename(studyId)).readAsStringSync();
study = SmartphoneStudyProtocol.fromJson(
json.decode(jsonString) as Map<String, dynamic>);
} catch (exception) {
warning("Failed to load study '$studyId' - $exception");
}
return study;
}