studyId property
String?
get
studyId
The ID of the study; null if not available.
The study ID is extracted from StudyInvitation.applicationData of the
invitation, either as a plain string or as the studyId field of a map.
Implementation
String? get studyId {
if (_studyId != null) return _studyId;
if (invitation.applicationData == null) return null;
if (invitation.applicationData is String) {
// The application data is a plain String, so we can return it directly.
_studyId = invitation.applicationData as String;
} else {
if (invitation.applicationData is Map<String, dynamic>) {
// The application data is JSON, so we can to parse it.
final appData = invitation.applicationData! as Map<String, dynamic>;
_studyId = appData['studyId'] as String?;
}
}
return _studyId;
}