Pragmatic Flutter
eBook - ePub

Pragmatic Flutter

Building Cross-Platform Mobile Apps for Android, iOS, Web & Desktop

  1. 370 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Pragmatic Flutter

Building Cross-Platform Mobile Apps for Android, iOS, Web & Desktop

About this book

Have you ever thought of creating beautiful, blazing-fast native apps for iOS and Android from a single codebase? Have you dreamt of taking your native apps to the web and desktop without it costing a fortune? If so, Pragmatic Flutter: Building Cross-Platform Mobile Apps for Android, iOS, Web & Desktop is the right place to start your journey to developing cross-platform apps. Google's Flutter is the brand-new way for developing beautiful, fluid, and blazing-fast cross-platform apps for Android, iOS, web, and desktops (macOS, Linux, Windows).

Google's new Fuchsia OS user interface (UI) is implemented using Flutter as well. Learning to develop mobile apps with Flutter opens the door to multiple devices, form-factors, and platforms using a single codebase. You don't need any prior experience using Dart to follow along in this book; however, it's recommended that readers have some familiarity with writing code using one of the object-oriented programming languages.

Your journey starts with learning to structure and organize the Flutter project to develop apps for multiple platforms. Next, you will explore the fundamentals of Flutter widgets. The journey continues with Flutter's layout widgets while also learning to build responsive layouts. You will get an understanding of organizing and applying themes and styles, handling user input, and gestures. Then you will move on to advanced concepts, such as fetching data over the network and integrating and consuming REST API in your app. You will get hands-on experience on design patterns, data modeling, routing, and navigation for multi-screen apps. When you are finished, you will have a solid foundational knowledge of Flutter that will help you move on to building great and successful mobile apps that can be deployed to Android, iOS, web, and desktop (macOS, Linux, Windows) platforms from a single codebase.

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Pragmatic Flutter by Priyanka Tyagi in PDF and/or ePUB format, as well as other popular books in Computer Science & Application Development. We have over one million books available in our catalogue for you to explore.

Information

1

Dart Fundamentals

A Quick Reference to Dart 2
Dart programming language is developed by Google. It has been around since 2011. However, it has gained popularity recently since Google announced Flutter software development kit (SDK) for developing cross-platform-applications. Dart aims to help developers build web and mobile applications effectively. It works for building production-ready solutions for client applications as well as for the server-side. Dart has an Ahead-of-Time (AOT) compiler that compiles predictable native code quickly for the target platform. It is optimized to build customized user interfaces natively for multiple platforms. The Dart is a developers-friendly programming language. It is easy for developers coming from different programming language backgrounds to learn Dart without much effort.
The Dart 2 (Announcing Dart 2 Stable and the Dart Web Platform) is the latest version of Dart language including the rewrite of many features, improved performance and productivity. This chapter covers the basics of Dart 2 language syntaxes (Google, 2020) to get started with the journey of building applications using Flutter. A prior understanding of object-oriented programming is needed to follow along with the material. Dart 2 and Dart will be used to infer the Dart 2 programming language in this book. In the upcoming topics, we'll review some of the language features with the help of examples.

THE main FUNCTION

The `main()` function is the entry point for any Dart program. The following code snippet will print “Hello Dart” on the console. Open a ‘Terminal’ at MacOS or its Windows or Linux equivalent. Create a file say ‘hello.dart’, and copy the following code snippet in it.
```
void main() {
print("Hello Dart");
}
```

RUNNING DART PROGRAM

Go back to the ‘Terminal’ and execute the file using `dart hello.dart`. The “Hello Dart” is printed on the console.
```
$ dart hello.dart
Hello Dart
```

VARIABLES & DATA TYPES

In Dart, you can use the `var` keyword to infer the underlying data type. The following code snippet shows declaring variable `data` to hold the numeric value ‘1’.
```
var data = 1;
print(data);
```
The above code snippet will print the ‘1’ on the console. The runtimeType (runtimeType property) property gives the runtime type of the object it's called on. The following code snippet will print the data type of the `data` variable as ‘int’ on the console.
```
var data = 1;
print(data.runtimeType);
```
It's valid for the `data` variable to get reassigned to a value from a different data type.
There's another keyword, `dynamic`, to assign a value to a variable similar ...

Table of contents

  1. Cover
  2. Half Title
  3. Title Page
  4. Copyright Page
  5. Dedication
  6. Contents
  7. Preface
  8. Author
  9. Chapter 1 Dart Fundamentals: A Quick Reference to Dart 2
  10. Chapter 2 Introduction to Flutter
  11. Chapter 3 Setting Up Environment
  12. Chapter 4 Flutter Project Structure
  13. Chapter 5 Flutter App Structure
  14. Chapter 6 Flutter Widgets
  15. Chapter 7 Building Layouts
  16. Chapter 8 Responsive Interfaces
  17. Chapter 9 Building User Interface for BooksApp
  18. Chapter 10 Flutter Themes
  19. Chapter 11 Persisting Data
  20. Chapter 12 Integrating REST API
  21. Chapter 13 Data Modeling
  22. Chapter 14 Navigation and Routing
  23. Chapter 15 The Second Page – BookDetailsPage Widget
  24. Chapter 16 Introduction to State Management
  25. Chapter 17 ValueNotifier
  26. Chapter 18 Provider and ChangeNotifier
  27. Chapter 19 BLoC Design Pattern
  28. Chapter 20 Unit Testing
  29. Chapter 21 Widget Testing
  30. Chapter 22 Integration Testing
  31. Chapter 23 Rolling into the World
  32. Index