Welcome to Manning India!

We are pleased to be able to offer regional eBook pricing for Indian residents.
All eBook prices are discounted 40% or more!
Flutter in Action
Eric Windmill
  • MEAP began September 2018
  • Publication in February 2020 (estimated)
  • ISBN 9781617296147
  • 310 pages (estimated)
  • printed in black & white

In this book, you’ll not only see how to use Flutter, but you’ll understand why using Flutter in the ways Eric and people online say to actually works in practice.

Ray Rischpater, Technical Program Manager, Flutter
In 2017, consumers downloaded 178 billion apps, and analysts predict growth to 258 billion by 2022. Mobile customers are demanding more—and better—apps, and it’s up to developers like you to write them! Flutter, a revolutionary new cross-platform software development kit created by Google, makes it easier than ever to write secure, high-performance native apps for iOS and Android. Flutter apps are blazingly fast because this open source solution compiles your Dart code to platform-specific programs with no JavaScript bridge! Flutter also supports hot reloading to update changes instantly. And thanks to its built-in widgets and rich motion APIs, Flutter’s apps are not just highly responsive, they’re stunning!
Table of Contents detailed table of contents

Part 1: Getting to know Flutter and Dart

1 Meet Flutter

1.1 Why Does Flutter Use Dart?

1.2 On Dart

1.3 Who Uses Flutter?

1.4 Who should be using Flutter?

1.4.1 Teams, Project Leads, and CTOs

1.4.2 Individual Developers

1.4.3 Code School Students and Recent CS Grads

1.4.4 Open Source Developers

1.4.5 People Who Value Speed

1.4.6 People Who Are Lazy

1.4.7 People Who Value Control

1.5 Who is This Book For?

1.6 Other Mobile Development Options

1.6.1 Native Development (iOS and Android)

1.6.2 Cross-Platform JavaScript Options

1.7 The Immediate Benefits of Flutter

1.7.1 No JavaScript Bridge

1.7.2 Compile Time

1.7.3 Write Once, Test Once, Deploy Everywhere

1.7.4 Code Sharing

1.7.5 Productivity and Collaboration

1.7.6 Code Maintenance

1.7.7 The Bottom Line: Is Flutter for You?

1.8 Future Benefits of Flutter: Web apps and desktop apps

1.9 A Brief Intro into How Flutter Works

1.9.1 Everything is A Widget

1.9.2 Composing UI with Widgets

1.9.3 Widget Types

1.10 Flutter Rendering: Under the Hood

1.10.1 Compose the Widget Tree and Layout

1.10.2 Composite step

1.10.3 Paint to the screen

1.11 Final Note

1.12 Summary

2 A Brief Intro to Dart

2.1 Hello, Dart!

2.1.1 Anatomy of a Dart Program

2.1.2 Add more greetings

2.1.3 I/O and Dart Libraries

2.2 Common Programming Concepts In Dart

2.2.1 Intro to Dart’s Type System

2.2.2 Comments

2.2.3 Variables and Assignment

2.2.4 Operators

2.2.5 Null Aware Operators

2.3 Control Flow

2.3.1 if and else

2.3.2 switch and case

2.3.3 Advanced Switch usage

2.3.4 Loops

2.4 Functions

2.4.1 Anatomy of a Dart Function

2.4.2 Parameters

2.4.3 Default parameter values

2.4.4 Advanced Function Concepts

2.4.5 Lexical Scope

2.5 Object Oriented Programming (in Dart)

2.5.1 Classes

2.5.2 Constructors

2.5.3 Inheritance

2.5.4 Factories and Named Constructors

2.5.5 Enumerators

2.6 A note about more Dart features

2.7 Summary

3 Breaking into Flutter

3.1 Intro to the counter app

3.1.1 Flutter project structure

3.1.2 Anatomy of a Flutter App

3.1.3 Again, "Everything is a Widget"

3.1.4 The build method

3.1.5 new and const constructors in Flutter

3.1.6 Hot Reload

3.2 Widgets: The widget tree, widget types and the State object

3.2.1 Stateless Widget

3.2.2 Stateful Widget

3.2.3 setState

3.2.4 initState

3.3 BuildContext

3.4 Enhancing the Counter app with the most important widgets

3.4.1 Raised Button

3.5 Intro to Layout in Flutter

3.5.1 Row and Column

3.5.2 Layout Constraints in Flutter

3.5.3 RenderObject

3.5.4 RenderObject and Constraints

3.5.5 RenderBoxes and layout errors

3.5.6 Multi-child widgets

3.5.7 Icons and the FloatingActionButton

3.5.8 Images

3.5.9 Container Widget

3.6 The Element Tree

3.6.1 Elements and Widgets

3.6.2 Exploring the Element Tree with an example

3.6.3 The Element Tree and State Objects

3.6.4 Widget Keys

3.7 A final note

3.8 Summary

Part 2: Flutter user interaction, styles and animations

4 Flutter UI: Important Widgets, Theme, and Layout

4.1 Setting up and configuring a Flutter app

4.1.1 Configuration: pubspec and main.dart

4.1.2 SystemChrome

4.2 Structural Widgets and more configuration

4.2.1 MaterialApp widget

4.2.2 Scaffold

4.2.3 AppBar and PreferredSizeWidget

4.3 Styling in Flutter and Theme

4.3.1 Theme

4.3.2 MediaQuery and the of method

4.3.3 ScreenAwareSize method

4.4 Common Layout and UI widgets

4.4.1 Stack

4.4.2 Table

4.4.3 TabBar

4.5 ListView and Builders

4.6 Summary

5 User Interaction: Forms and Gestures

5.1 User interaction and gestures

5.1.1 The GestureDetector widget

5.1.2 The GestureDetector in practice

5.1.3 Dismissible

5.2 Flutter Forms

5.2.1 The Form widget

5.2.2 GlobalKey<FormState>

5.3 FormField widgets

5.3.1 TextFormField

5.3.2 DropdownFormButton

5.3.3 Generic Form Fields

5.4 Form UI and working with focus nodes

5.4.1 InputDecoration

5.4.2 Improve UI with FocusNodes

5.5 Form methods help manage form state

5.5.1 Form.onChange

5.5.2 FormState.save

5.5.3 Form.onWillPop

5.6 Summary

6 Pushing Pixels: Flutter Animations and using the Canvas

6.1 Introducing Flutter Animations

6.1.1 Tweens

6.1.2 Animation Curves

6.1.3 Ticker providers

6.1.4 AnimationController

6.1.5 AnimatedWidget

6.1.6 Implementing the AnimationController and Tween for the background

6.2 CustomPainter and the Canvas

6.2.1 The shapes used to make up the clouds

6.2.2 Define the CustomPainter and Paint object

6.2.3 CustomPainter paint method

6.3 Animations Again: Staggered animations, TweenSequence, and built in animations

6.3.1 Creating a custom animation state class

6.3.2 Built in animation widgets: SlideTransition

6.3.3 TweenSequence

6.4 Reusable color transition custom widgets

6.5 Summary

Part 3: State management and asynchronous Dart

7 Flutter Routing In Depth

7.1 Routing in Flutter

7.1.1 The Farmers Market app

7.1.2 The app source code

7.2 Declarative Routing and Named Routes

7.2.1 Declaring routes

7.2.2 MaterialDrawer widget and a the full menu

7.2.3 Menu items and the appropriate widgets: ListView and ListItems

7.2.4 NavigatorObserver: Highlight active route with RouteAware

7.3 Routing on the Fly

7.3.1 MaterialRouteBuilder

7.3.2 showSnackBar, showBottomSheet and the like

7.4 Routing Animations

7.5 Summary

8 Flutter State Management

8.1 Deep Dive into StatefulWidget

8.1.1 The Widget Tree and the Element Tree

8.1.2 The StatefulWidget Lifecycle and When to Do What

8.2 Pure Flutter state management: The InheritedWidget

8.2.1 Creating a Central Store wth an InheritedWidget + StatefulWidget team

8.2.2 The 'inheritFromWidgetOfExactType' and 'of' methods

8.2.3 Use the of method to lift state up

8.2.4 State management patterns beyond Flutter

8.3 Blocs: Business Logic Components

8.3.1 Blocs. How do they work?

8.3.2 Implementing the Bloc architecture

8.3.3 Intro to Streams and Async Dart

8.3.4 Implementing Streams in the CartBloc

8.4 Summary

9 Async Dart and Flutter and Infinite Scrolling

9.1 Async Dart

9.1.1 Future Recap

9.1.2 async / await

9.1.3 Catching errors with Futures

9.1.4 Catching errors with try and catch

9.2 Sinks and Streams (and StreamControllers)

9.2.1 The pieces of the observer patter

9.2.2 Implementing streams

9.2.3 Broadcast streams

9.2.4 Higher Order Streams

9.3 Using streams in blocs

9.3.1 Blocs use "inputs" and "outputs"

9.3.2 Implementing a bloc input

9.4 Async Flutter: StreamBuilder

9.5 Infinite and Custom Scrollable widgets

9.5.1 CustomScrollView and Slivers

9.5.2 CatalogWidget scroll view

9.5.3 Delegates

9.5.4 Custom sliver

9.6 Summary

Part 4: Beyond foundations

10 Working with data: HTTP, Firestore, and JSON

10.1 HTTP and Flutter

10.1.1 HTTP package

10.1.2 GET request

10.2 JSON Serialization

10.2.1 Manual Serialization

10.2.2 Auto generated Json serialization

10.2.3 Updating the Todo class

10.2.4 Bring it all together in the UI

10.3 Working with Firebase in Flutter

10.3.1 Installing Firestore

10.3.2 Create a Firestore project

10.3.3 Configure your app

10.3.4 Add Firebase to your pubspec

10.3.5 Using Firestore

10.4 Dependency Injection

10.4.1 Dependency Injection in the app

10.5 Summary

11 Testing Flutter Apps

11.1 Testing Flutter apps

11.1.1 Setup for Dart Unit tests

11.1.2 Writing Dart unit tests

11.1.3 Using Mockito to test methods that need external dependencies

11.1.4 Flutter widget tests

11.1.5 Flutter integration tests

11.1.6 Performance profiling integration tests

11.2 Accessibility with the Semantics widgets

11.3 Next Steps with Flutter

11.4 Summary

Appendixes

Appendix A: Installation: Dart2

A.1 Mac OS

A.2 Windows

A.3 Linux

A.4 Installation: Flutter SDK

A.4.1 Mac OS

A.4.2 Windows

A.4.3 Linux

A.5 Tooling

A.5.1 A quick note on Text Editors

A.6 Dart Pad

Appendix B: Pub package manager

B.1 Hosted Packages and Versioning with Pub

B.2 Using packages on your machine or from github

B.2.1 Git

B.2.2 Local packages

B.3 Using the packages

Appendix C: Flutter for web developers

C.1 The good news, first

C.2 How is layout handled in Flutter? Is there a flex-box equivalent?

C.3 What about using position: absolute?

C.4 What about the basics: Borders, Padding, Margin and color?

C.5 Manipulating text style

C.6 Global styles

Appendix D: Flutter for iOS developers

D.1 What are the equivalent to UIView in Flutter?

D.2 What is the paradigm or mental model difference?

D.3 Can I build an app that uses iOS design patterns?

D.4 How to I make complex layouts like UITableView?

D.5 What’s similar to Storyboard?

D.6 How do you draw to the screen?

D.7 How do I add dependencies (like Cocoa Pods)?

D.8 How do I interact with the device and use native APIs?

D.9 Is there an equivalent to CoreData?

Appendix E: Flutter for Android developers

E.1 What is the equivalent of a View in Flutter?

E.2 What is the paradigm or mental model difference?

E.3 Where is the XML layout file?

E.4 How do I draw to the screen?

E.5 What is the equivalent of an Intent in Flutter?

E.6 What is the equivalent of runOnUiThread() in Flutter?

E.7 What is the equivalent of a Gradle file? How do I add dependencies?

E.8 What is the equivalent of a LinearLayout? What about ScrollView?

E.9 How do I access shared preferences or SQLite?

About the book

Flutter in Action teaches you to build awesome, full-featured mobile applications with Flutter. Author Eric Windmill walks with you every step of the way as you build apps that get you coding as you learn. With the engaging hands-on examples, you’ll create a basic user interface, learn about state management, and integrate a database with a Dart web app. You’ll also delve into widgets, styling with themes, animations, handling user input, and more. As a bonus, you’ll gain experience coding in Google’s instantly familiar Dart programming language, which has features sure to boost your productivity. Programmers familiar with any high-level language will feel right at home with Dart. If you want to build beautiful, fast, cross-platform mobile apps, you need this easy-to-follow tutorial! And with Eric Windmill’s informal, friendly style, learning Flutter is as much fun as writing the apps!

What's inside

  • Understanding the basic Flutter UI
  • Working with widgets
  • Building layouts in Flutter
  • State management
  • Handling user input
  • Integrating platform-specific functionality for iOS and Android
  • Sharing code between Flutter and the web
  • Built-in and custom animations
  • Testing and debugging

About the reader

For developers familiar with the basics of programming web applications. No experience with Dart or Flutter needed!

About the author

Eric Windmill is a professional Dart developer, a contributor to open-source Flutter projects, and the author of FlutterByExample.com. His work is featured on Flutter’s own showcase page, https://flutter.io/showcase.

Manning Early Access Program (MEAP) Read chapters as they are written, get the finished eBook as soon as it’s ready, and receive the pBook long before it's in bookstores.
MEAP combo $49.99 pBook + eBook + liveBook
MEAP eBook $39.99 pdf + ePub + kindle + liveBook
Prices displayed in rupees will be charged in USD when you check out.

placing your order...

Don't refresh or navigate away from the page.

FREE domestic shipping on three or more pBooks