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