Book Image

Cross-Platform UIs with Flutter

By : Ryan Edge, Alberto Miola
Book Image

Cross-Platform UIs with Flutter

By: Ryan Edge, Alberto Miola

Overview of this book

Flutter is a UI toolkit for building beautiful, natively compiled applications for mobile, web, desktop, and embedded devices from a single code base. With Flutter, you can write your code once and run it anywhere using a single code base to target multiple platforms. This book is a comprehensive, project-based guide for new and emerging Flutter developers that will help empower you to build bulletproof applications. Once you start reading book, you’ll quickly realize what sets Flutter apart from its competition and establish some of the fundamentals of the toolkit. As you work on various project applications, you’ll understand just how easy Flutter is to use for building stunning UIs. This book covers navigation strategies, state management, advanced animation handling, and the two main UI design styles: Material and Cupertino. It’ll help you extend your knowledge with good code practices, UI testing strategies, and CI setup to constantly keep your repository’s quality at the highest level possible. By the end of this book, you'll feel confident in your ability to transfer the lessons from the example projects and build your own Flutter applications for any platform you wish.
Table of Contents (12 chapters)

Setting up the project

In this chapter, we will learn how to use Flutter’s form APIs to build an interactive Contacts application that allows us to create a list of contacts that includes their First name, Last name, Phone, and Email.

When we have finished, the resulting application should look as follows:

Figure 6.1 – Completed Contacts application

Figure 6.1 – Completed Contacts application

In the preceding figure, we see three different screens:

  • A home screen that displays a list of contacts using an avatar of their first initial and their full name
  • A details screen that allows us to view each contact’s information
  • A create/edit screen that allows us to edit existing contacts or create a new one

We will start with an example that already includes the List and Details views in the contact_list_view.dart and contact_details_view.dart files, respectively. The application uses GoRouter and Provider as dependencies for routing, state management, and dependency...