books_finder 1.0.2+4
books_finder: ^1.0.2+4 copied to clipboard
A library to help on the search for books on google books api
A library to help on the search for books on google books api.
Querying books #
First of all, import the library:
import 'package:books_finder/books_finder.dart';
To query a book, just call the function queryBooks:
final books = await queryBooks(
'twilight',
maxResults: 3,
printType: PrintType.books,
orderBy: OrderBy.relevance,
);
You can change a few parameters to make your query more specific:
- Set
langRestrictto restrict the query to a specific language - Set
orderByto order the query by newest or relevance andprintTypeto filter in books or magazines - Set
maxResultsto set the max amount of results. - Set
startIndexfor pagination
Specific books #
First of all, to get a specific book, you need its id. You can get the book id by querying the name of it and calling book.id.
Next step is to get the book. To get it, just call the function getSpecificBook. For example:
final specificBook = await getSpecificBook(book.id);
But if you already have a book object, you can just call:
final completeInfo = await book.completeInfoBook;
Books #
If you already have a Book object, you can call book.info to get all the book infos.
- title: returns a
Stringwith the title of the book - authors: returns a
list of stringswith all the authors names - publisher: returns a
Stringwith the publisher name - publishedDate: returns a
DateTimewith the published date - description: returns a
Stringwith the description of the book - pageCount: returns a
intwith the amount of pages the book has - categories: returns a
list of stringswith the categories the book is in - averageRating: returns a
doublewith the average rating of the book - ratingsCount: returns a
intwith the amount of people that rated the book - maturityRating: returns a
Stringwith the maturity rating of the book - contentVersion: returns a
Stringwith the content version - imageLinks: returns a
List<Map<String, Uri>>with all the avaiable image resources urls - language: returns a
Stringwith the language code of the book
Open source #
This project is open source and is under BSD LICENCE. Feel free to open an issue or make a pull request to the project.