Programming Flutter

Book description

Work in Flutter, a framework designed from the ground up for dual platform development, with support for native Java/Kotlin or Objective-C/Swift methods from Flutter apps. 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.

Publisher resources

View/Submit Errata

Table of contents

  1.  Acknowledgments
  2.  Preface
    1. A Brief History of Flutter
    2. Why Flutter Matters and What We’ll See in This Book
    3. Don’t Know Dart? Don’t Worry About It
    4. Installing the SDK and the IDE Plugins
    5. Where We’re Going Next: Let’s Start Building Apps
  3. Part I. Getting Started with Flutter
    1. 1. Making Your First Flutter App
      1. Get Familiar with Dart Syntax and Flutter Classes
      2. Give the App Your Personal Touch
      3. Where We’re Going Next
    2. 2. Laying Out More Widgets
      1. Introducing Layout Widgets
      2. Contain and Add Padding to Widgets Using Invisible Layout Widgets
      3. Add Your Own Assets to the App
      4. Displaying Images
      5. Vertical Layout
      6. Horizontal Layout: The Row
      7. Making Grids
      8. The Card
      9. Fill the Space Available in the View Using Expanded
      10. Slivers, Custom Scrollables, and Collapsable App Bars
      11. The Key
      12. Where We’re Going Next
    3. 3. Building a Calculator App
      1. Importing Basic Dependencies
      2. Writing main
      3. The Calculator’s Home Page
      4. How the App Will Be Structured
      5. Implement the Basic Layout
      6. Let’s Give the Calculator a Screen
      7. Add the Deletion Row
      8. The Third Row
      9. Why a GridView Wouldn’t Work
      10. Make the App Look and Work Right with Expanded
      11. The Finished Layout
      12. Implement the Calculations
      13. Use the Calculation Inside the App
      14. Wrapping Up the Calculator
      15. What If We Try to Divide by 0?
      16. Where We’re Going Next
    4. 4. Beyond the Standard Library: Plugins and Packages
      1. An Introduction to Packages
      2. Package Usage Example
      3. Making Your Own Packages
      4. Publishing a Package to Pub
      5. Packages for Windows, macOS, and Linux
      6. Where We’re Going Next
  4. Part II. Doing More with Flutter
    1. 5. Network and Storage I/O and Navigation
      1. The API
      2. The http Package
      3. Writing Methods to Fetch Comics
      4. What You Need to Build the UI: Navigation and the InheritedWidget
      5. Build the App’s Basic UI
      6. Building the Comic Page
      7. Using the CircularProgressIndicator
      8. Making Everything Faster by Caching to Local Storage
      9. Allowing the User to Click the Image and Go to the Website: The url_launcher Package
      10. Adding Comic Selection by Number
      11. Permanent Data I/O in Flutter: Adding “Starred” Comics
      12. Where We’re Going Next
    2. 6. Testing and Debugging Flutter Apps
      1. Testing
      2. Testing the XKCD App: Using Mock Objects
      3. Throwing and Catching Exceptions
      4. Assert Statements
      5. Where We’re Going Next
    3. 7. Build a Chat App Using Firebase
      1. What Is Firebase?
      2. Animations and Transistions
      3. Custom Shapes and Drawing in Flutter Apps Using Painters
      4. The StreamBuilder
      5. Building the Chat App
      6. Where You’re Going Next
  5. A1. Introduction to Dart
    1. Comments in Dart
    2. Variables and Conditions
    3. Functions
    4. main
    5. Asynchronous Code in Dart: The dart:async Library
    6. Conditional Constructs and Expressions
    7. Loops: while, do while, and for
    8. Classes
    9. Typedef and Callbacks
    10. Mastering import
    11. Conversion Between Native Java/Apple and Dart Data Types
    12. Where You’re Going Next
  6. A2. Apple-Like Look and Additional App Configuration
    1. Cupertino Widgets
    2. pubspec.yaml
    3. Platform-Specific Setup

Product information

  • Title: Programming Flutter
  • Author(s): Carmine Zaccagnino
  • Release date: February 2020
  • Publisher(s): Pragmatic Bookshelf
  • ISBN: 9781680507638