Pages: 368 Published: February 2020 ISBN: 9781680506952
In Print
Programming Flutter
Native, Cross-Platform Apps the Easy Way
by Carmine Zaccagnino
Develop your next app with Flutter and deliver native look, feel, and
performance on both iOS and Android from a single code base. Bring along
your favorite libraries and existing code from Java, Kotlin,
Objective-C, and Swift, so you don’t have to start over from scratch.
Write your next app in one language, and build it for both Android and
iOS. Deliver the native look, feel, and performance you and your users
expect from an app written with each platform’s own tools and languages.
Deliver apps fast, doing half the work you were doing before and
exploiting powerful new features to speed up development. Write once,
run anywhere.
Learn Flutter, Google’s multi-platform mobile development framework.
Instantly view the changes you make to an app with stateful hot reload,
and define a declarative UI in the same language as the app logic
without having to use separate XML UI files. You can also reuse existing
platform-specific Android and iOS code and interact with it in an
efficient and simple way.
Use built-in UI elements—or build your own—to create a simple
calculator app. Run native Java/Kotlin or Objective-C/Swift methods from
your Flutter apps, and use a Flutter package to make HTTP requests to a
Web API or to perform read and write operations on local storage. Apply
visual effects to widgets, create transitions and animations, create a
chat app using Firebase, and deploy everything on both platforms.
Get native look and feel and performance in your Android and iOS apps,
and the ability to build for both platforms from a single code base.
What You Need
Flutter can be used for Android development on any Linux, Windows or
macOS computer, but macOS is needed for iOS development.
Production is complete. Now it’s on to layout and the printer.
2019/12/12
B3.0
Content-complete and headed to copy edit and indexing.
2019/08/13
B2.0
*Added Appendix 2, Apple-like Look and Additional App Configuration;
*added Appendix 1, Introduction to Dart;
*addressed the erratum filed for Beta 1;
*resized and improved some images;
*corrected some typos.
What You Need to Build the UI: Navigation and the
InheritedWidget
excerpt
Build the App’s Basic UI
Building the Comic Page
Using the CircularProgressIndicator
Making Everything Faster by Caching to Local Storage
Allowing the User to Click the Image and Go to the Website:
The url_launcher Package
Adding Comic Selection by Number
Permanent Data I/O in Flutter: Adding “Starred” Comics
Where We’re Going Next
Testing and Debugging Flutter Apps
Testing
Testing the XKCD App: Using Mock Objects
Throwing and Catching Exceptions
Assert Statements
Where We’re Going Next
Build a Chat App Using Firebase
What Is Firebase?
Animations and Transistions
Custom Shapes and Drawing in Flutter Apps Using Painters
The StreamBuilder
Building the Chat App
Where You’re Going Next
Author
Carmine Zaccagnino is a web and mobile developer and has struggled
for years building Android apps using the standard SDK and, in a lesser
way, Web-based tools. His experience in development areas other than
mobile development has led him to be particularly bothered by the lack
of a native (or close to native) framework that can bridge together
Android and iOS without losing low-level access to hardware and
software, until Flutter did exactly what was needed.