DatabaseHelper class

Helper per la gestione del database SQLite dell'app. Implementa il pattern Singleton e fornisce metodi CRUD per la tabella 'libri'.

Constructors

DatabaseHelper.new()
Restituisce l'istanza singleton di DatabaseHelper.
factory

Properties

database Future<Database>
Restituisce il database, inizializzandolo se necessario.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() Future<void>
Chiude la connessione al database.
deleteLibro(String isbn) Future<void>
Elimina il libro con l'isbn specificato dalla tabella 'libri'.
getAllLibri() Future<List<Libro>>
Restituisce la lista di tutti i libri presenti nella tabella 'libri'.
getLibro(String isbn) Future<Libro?>
Restituisce il libro con l'isbn specificato, oppure null se non trovato.
insertLibro(Libro libro) Future<void>
Inserisce un nuovo libro nella tabella 'libri'.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
updateLibro(Libro libro) Future<void>
Aggiorna i dati di un libro esistente nella tabella 'libri'.

Operators

operator ==(Object other) bool
The equality operator.
inherited