getLibriPerGenere method
- GenereLibro? genere
Restituisce i libri in base al genere specificato.
Se genere
è null, restituisce tutti i libri.
Implementation
List<Libro> getLibriPerGenere(GenereLibro? genere) {
if (genere == null) {
return getLibri(); // Restituisco tutti i libri se il genere è null
}
return cerca((libro) => libro.genere == genere);
}