Created
February 20, 2018 17:00
-
-
Save Norbert515/27c60fb8b69c16157a27db7618d74c82 to your computer and use it in GitHub Desktop.
getBook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Get a book by its id, if there is not entry for that ID, returns null. | |
Future<Book> getBook(String id) async{ | |
var result = await db.rawQuery('SELECT * FROM $tableName WHERE ${Book.db_id} = "$id"'); | |
if(result.length == 0)return null; | |
return new Book.fromMap(result[0]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment