Creating a responsive UI

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:

  1. 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: 'My Books',       theme: ThemeData(         primarySwatch: Colors.blueGrey, ...

Get Flutter Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.