On the home page of our app, we want to show the user a text field to search for any book from the Google Books API library. The results will be shown under the search box, and the appearance of the results will depend on the screen. From here, the user will be able to add a book to their favorites. Let's look at the steps, as follows:
- Replace the default example code in the main.dart file with the following:
import 'package:flutter/material.dart';
import './data/bookshelper.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title...