Chapters

Hide chapters

Flutter Apprentice

Fourth Edition · Flutter 3.16.9 · Dart 3.2.6 · Android Studio 2023.1.1

Section II: Everything’s a Widget

Section 2: 5 chapters
Show chapters Hide chapters

Section IV: Networking, Persistence & State

Section 4: 6 chapters
Show chapters Hide chapters

Welcome to Flutter Apprentice!

Flutter is an incredible user interface (UI) toolkit that lets you build apps for iOS and Android — and even the web and desktop platforms like macOS, Windows and Linux — all from a single codebase.

Flutter has all the benefits of other cross-platform tools, especially because you’re targeting multiple platforms from one codebase. Furthermore, it improves upon most cross-platform tools thanks to a super-fast rendering engine that makes your Flutter apps perform as native apps.

In addition, Flutter features are generally independent of native features, since you use Flutter’s own type of UI elements, called widgets, to create your UI. And Flutter has the ability to work with native code, so you can integrate your Flutter app with native features when you need to.

If you’re coming from a platform like iOS or Android, you’ll find the Flutter development experience refreshing! Thanks to a feature called “hot reload”, you rarely need to rebuild your apps as you develop them. A running app in a simulator or emulator will refresh with code changes automatically as you save your source files!

In this book, you’ll see how to build full-featured Flutter apps, gain experience with a wide range of Flutter widgets and learn how to deploy your apps to mobile app stores.

How to Read This Book

In the first section of the book, you’ll learn how to set up a Flutter development environment. Once that’s done, you’ll start building your first Flutter app.

The next two sections focus on UI development with Flutter widgets. You’ll see just how impressive Flutter user interfaces can be.

The fourth section switches to building a new app. You’ll use it to learn about using networking and databases with Flutter, as well as the all-important topic of state management.

The fifth section teaches you how to work with Firebase Cloud Firestore. In particular you’ll learn how to add an instant messaging feature to the Yummy app.

The sixth section is about testing. You’ll learn how to take advantage of unit and widget tests to make sure you app behaves as expected.

The seventh section shows you how to incorporate platform-specific assets into your app, then demonstrates how to deploy your apps to the mobile app stores.

Here’s a breakdown of these seven main sections of the book:

Section I: Build Your First Flutter App

The chapters in this section introduce you to Flutter, get you up and running with a Flutter development environment and walk you through building your first Flutter app.

You’ll learn about where Flutter came from and why it exists, understand the structure of Flutter projects and see how to create the UI of a Flutter app.

You’ll also get your first introduction to the key component found in Flutter user interfaces: widgets!

Section II: Everything’s a Widget

In this section, you’ll start to build a full-featured recipe app named Yummy. You’ll gain an understanding of the wide range of widgets available in Flutter and put them to use. Then you’ll learn the theory of how widgets work behind the scenes.

Finally, you’ll dive deeper into layout widgets, scrollable widgets and interactive widgets.

Section III: Navigating Between Screens

You’ll continue working on the Yummy app in this section, learning about navigating between screens and working with deep links.

Topics you’ll learn include Navigator 2.0 and Flutter Web.

Section IV: Networking, Persistence & State

Most apps interact with the network to retrieve data and then persist that data locally in some form of cache, such as a database. In this section, you’ll build a new app that lets you search the Internet for recipes, bookmark recipes and save their ingredients into a shopping list.

You’ll learn about making network requests, parsing the network JSON response and saving data in a SQLite database. You’ll also get an introduction to using Dart streams.

Finally, this section will dive deeper into the important topic of app state, which determines where and how to refresh data in the UI as a user interacts with your app.

Section V: Working With Firebase Cloud Firestore

When it comes to storing data in the cloud you can build your own backend system or you can leverage an existing system, built exactly for that.

This section will explain how to use Firebase Cloud Firestore to implement a messaging feature into your app. You’ll learn how to integrate Firebase into your project, how to set up authentication and how to make queries to populate your UI.

Section VI: Testing your Flutter app

Building an app is fun, but along the way you’ll add features, tweak flows and fix bugs. How do you make sure that a set of changes doesn’t introduce bugs or issues in a previous version of the app? Enter testing. Testing helps you mitigate the risk of introducing issues into an existing app and to prevent regressions.

In this section you’ll learn about both unit and widget tests. You’ll see how unit tests are a good fit to keep in check your business logic. Finally, you’ll learn how to make use of widget tests to verify that your UI widgets are rendered as expected.

Section VII: Deployment

Building an app for your own devices is great; sharing your app with the world is even better!

In this section, you’ll go over the steps and processes to release your apps to the iOS App Store and Google Play Store. You’ll also see how to use platform-specific assets in your apps.

Have a technical question? Want to report a bug? You can ask questions and report bugs to the book authors in our official book forum here.
© 2024 Kodeco Inc.