Table of Contents

Copyright

Brief Table of Contents

Table of Contents

Foreword

Preface

Acknowledgments

About This Book

About the Author

About the Cover Illustration

1. Meet Flutter

Chapter 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 this book is 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 to 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. Composing the widget tree and layout

1.10.2. Compositing step

1.10.3. Paint to the screen

1.11. Final note

Summary

Chapter 2. A brief intro to Dart

2.1. Hello, Dart!

2.1.1. Anatomy of a Dart program

2.1.2. Adding 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

Summary

Chapter 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. The 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 widgets

3.2.2. Stateful widgets

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. RaisedButton

3.5. Favor composition in Flutter (over inheritance)

3.5.1. What is composition?

3.5.2. An example of composition in Flutter

3.6. Intro to layout in Flutter

3.6.1. Row and Column

3.6.2. Layout constraints in Flutter

3.6.3. RenderObject

3.6.4. RenderObject and constraints

3.6.5. RenderBoxes and layout errors

3.6.6. Multi-child widgets

3.6.7. Icons and the FloatingActionButton

3.6.8. Images

3.6.9. Container widget

3.7. The element tree

3.7.1. Elements and widgets

3.7.2. Exploring the element tree with an example

3.7.3. The element tree and State objects

3.7.4. Widget keys

3.8. A final note

Summary

2. Flutter user interaction, styles, and animations

Chapter 4. Flutter UI: Important widgets, themes, and layout

4.1. Setting up and configuring a Flutter app

4.1.1. Configuration: pubspec.yaml and main.dart

4.1.2. SystemChrome

4.2. Structural widgets and more configuration

4.2.1. MaterialApp widget

4.2.2. The Scaffold widget

4.2.3. AppBar widget

4.3. Styling and themes in Flutter

4.3.1. Theme widget

4.3.2. MediaQuery and the of method

4.3.3. ScreenAwareSize method

4.4. Common layout and UI widgets

4.4.1. Stack widget

4.4.2. Table widget

4.4.3. TabBar widget

4.5. ListView and builders

Summary

Chapter 5. User interaction: Forms and gestures

5.1. User interaction and gestures

5.1.1. The GestureDetector widget

5.1.2. GestureDetector in practice

5.1.3. The Dismissible widget

5.2. Flutter forms

5.2.1. The Form widget

5.2.2. GlobalKey<FormState>

5.2.3. The structure of the AddCityPage form

5.2.4. Implementing the form in the weather app

5.3. FormField widgets

5.3.1. The TextFormField widget

5.3.2. The DropdownFormButton widget

5.3.3. Generic form fields

5.4. Form UI and working with focus nodes

5.4.1. InputDecoration

5.4.2. Improving the UI with FocusNodes

5.5. Managing form state with form methods

5.5.1. Form.onChange

5.5.2. FormState.save

5.5.3. Form.onWillPop

Summary

Chapter 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 animation controller 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. Defining the CustomPainter and the Paint object

6.2.3. The CustomPainter paint method

6.3. 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. Building animations for the Clouds widget

6.3.4. TweenSequence

6.4. Reusable custom color transition widgets

Summary

3. State management and asynchronous Dart

Chapter 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. Navigating to named routes

7.2.3. MaterialDrawer widget and the full menu

7.2.4. Menu items and the appropriate widgets: ListView and ListItems

7.2.5. NavigatorObserver: Highlighting the 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

Summary

Chapter 8. Flutter state management

8.1. Deep dive into StatefulWidgets

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 up state

8.2.4. State management patterns beyond Flutter

8.3. Blocs: Business Logic Components

8.3.1. How do blocs 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

Summary

Chapter 9. Async Dart and Flutter and infinite scrolling

9.1. Async Dart

9.1.1. Future recap

9.1.2. The async/await keywords

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. Anatomy of the observer pattern with Dart streams

9.2.2. Implementing streams

9.2.3. Broadcasting 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. Catalog widget scroll view

9.5.3. The SliverGrid widget

9.5.4. Delegates

9.5.5. Custom slivers

Summary

4. Beyond foundations

Chapter 10. Working with data: HTTP, Firestore, and JSON

10.1. HTTP and Flutter

10.1.1. HTTP package

10.1.2. GET requests

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. Bringing 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

Summary

Chapter 11. Testing Flutter apps

11.1. Tests in Flutter

11.1.1. Dart unit tests

11.1.2. Using mockito to test methods that need external dependencies

11.1.3. Flutter widget tests

11.1.4. Flutter integration tests

11.1.5. Performance profiling integration tests

11.2. Accessibility with the semantics widgets

11.3. Next steps with Flutter

Summary

A. Installation: Dart2

A.1. Installation: Dart2

A.1.1. Mac OS

A.1.2. Windows OS

A.1.3. Linux

A.2. Installation: Flutter SDK

A.2.1. Mac OS

A.2.2. Windows

A.2.3. Linux

A.3. Tooling and a quick note on text editors

A.4. DartPad

B. The 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

C. Flutter for web developers

C.1. The good news first

C.2. How is layout handled in Flutter? Is there a flexbox equivalent?

C.3. What about using an absolute position?

C.4. What about the basics: Borders, padding, margin, and color?

C.5. Manipulating text style

C.6. Global styles

D. Flutter for iOS developers

D.1. What’s the equivalent of UIView in Flutter?

D.2. What’s 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?

E. Flutter for Android developers

E.1. What’s the equivalent of a view in Flutter?

E.2. What’s the paradigm or mental model difference?

E.3. Where’s the XML layout file?

E.4. How do I draw to the screen?

E.5. What’s the equivalent of an intent in Flutter?

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

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

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

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

  

Index

List of Figures

List of Tables

List of Listings

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.237.29