Book Image

Taking Flutter to the Web

By : Damodar Lohani
Book Image

Taking Flutter to the Web

By: Damodar Lohani

Overview of this book

Using a shared codebase in addition to an extensive range of tools in the Flutter ecosystem optimized for browsers, the Flutter framework has expanded to enable you to bring your mobile apps to the web. You’ll find out how web developers can leverage the Flutter framework for web apps with this hands-on guide. Taking Flutter to the Web will help you learn all about the Flutter ecosystem by covering the tools and project structure that allows you to easily integrate Flutter into your web stack. You’ll understand the concepts of cross-platform UI development and how they can be applied to web platforms. As you explore Flutter on the web, you'll become well-versed with using Flutter as an alternative UI platform for building adaptive and responsive designs for web apps. By the end of this Flutter book, you'll have built and deployed a complete Flutter app for the web and have a roadmap ready to target the web for your existing Flutter mobile apps.
Table of Contents (17 chapters)
1
Part 1: Basics of Flutter Web
5
Part 2: Flutter Web under the Hood
9
Part 3: Advanced Concepts

Using Firestore Database to persist data

Firebase also provides a database service to persist data. There are two databases in Firebase. The first is Realtime Database and the second is Firestore. Firestore is a new, more optimized real-time database, which is why we will be learning about Firestore. Firestore provides flexible, hierarchical data structures. Data is organized in collections and documents. A document can have a complex nested structure as well as subcollections. Data syncs across devices through real-time listeners. To use Firestore, we must first configure it in the console, which we will do in the next subsection.

Configuring Firestore Database

As with Authentication, we have to configure the database in the Firebase console first by following these steps:

  1. On the console, click on Build | Firestore Database from the sidebar.

Figure 10.11 – An overview of Firestore

  1. On the page that appears, click on the Create...