getDiseaseById method
- String id,
- AppLocalizations localizations
Gets a disease by its ID
id: The ID of the disease to retrievelocalizations: Localization instance for error messages
Returns the disease if found, or null if an error occurs
Implementation
Future<Disease?> getDiseaseById(
String id,
AppLocalizations localizations,
) async {
try {
return await _repository.getDiseaseById(id, localizations.localeName);
} catch (e) {
_errorMessage = localizations.viewModelErrorFailedToLoadDisease(
e.toString(),
);
notifyListeners();
return null;
}
}