Flutter in Action
eBook - ePub

Flutter in Action

Eric Windmill

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

Flutter in Action

Eric Windmill

Book details
Book preview
Table of contents
Citations

About This Book

SummaryIn 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!Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.About the technologyWith Flutter, you can build mobile applications using a single, feature-rich SDK that includes everything from a rendering engine to a testing environment. Flutter compiles programs written in Google's intuitive Dart language to platform-specific code so your iOS and Android games, utilities, and shopping platforms all run like native Java or Swift apps.About the book Flutter in Action teaches you to build professional-quality mobile applications using the Flutter SDK and the Dart programming language. You'll begin with a quick tour of Dart essentials and then dive into engaging, well-described techniques for building beautiful user interfaces using Flutter's huge collection of built-in widgets. The combination of diagrams, code examples, and annotations makes learning a snap. As you go, you'll appreciate how the author makes easy reading of complex topics like routing, state management, and async programming.What's inside Understanding the Flutter approach to the UI
All the Dart you need to get started
Creating custom animations
Testing and debuggingAbout the readerYou'll need basic web or mobile app development skills.About the author Eric Windmill is a professional Dart developer and a contributor to open-source Flutter projects. His work is featured on the Flutter Showcase page. Table of Contents: PART 1 - MEET FLUTTER1 Ā¦ Meet Flutter2 Ā¦ A brief intro to Dart3 Ā¦ Breaking into FlutterPART 2 - FLUTTER USER INTERACTION, STYLES, AND ANIMATIONS4 Ā¦ Flutter UI: Important widgets, themes, and layout5 Ā¦ User interaction: Forms and gestures6 Ā¦ Pushing pixels: Flutter animations and using the canvasPART 3 - STATE MANAGEMENT AND ASYNCHRONOUS DART7 Ā¦ Flutter routing in depth8 Ā¦ Flutter state management9 Ā¦ Async Dart and Flutter and infinite scrollingPART 4 - BEYOND FOUNDATIONS10 Ā¦ Working with data: HTTP, Firestore, and JSON11 Ā¦ Testing Flutter apps

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on ā€œCancel Subscriptionā€ - itā€™s as simple as that. After you cancel, your membership will stay active for the remainder of the time youā€™ve paid for. Learn more here.
Can/how do I download books?
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.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlegoā€™s features. The only differences are the price and subscription period: With the annual plan youā€™ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
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.
Do you support text-to-speech?
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.
Is Flutter in Action an online PDF/ePUB?
Yes, you can access Flutter in Action by Eric Windmill in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming Mobile Devices. We have over one million books available in our catalogue for you to explore.

Information

Publisher
Manning
Year
2020
ISBN
9781638356431

Part 1. Meet Flutter

The first section of this book is in three chapters, and itā€™s meant to prepare you to build full-blown Flutter apps. In particular, this includes three subjects.
First, Iā€™ll introduce all things Flutter in chapter 1. This includes the whos, whats, whys, and hows: how it works, why itā€™s worth investing in, and the mental model needed to use the SDK. This chapter is largely conceptual and involves little code.
I also devote a chapter to Dart, the programming language that Flutter uses. I like to call Dart Java Lite. And I mean that in a great way. If youā€™re comfortable with object-oriented and strongly typed languages, you can probably just skim this chapter.
Then, in chapter 3, weā€™ll explore Flutter itself. This chapter uses a simple Flutter example app to explain how Flutter works, both from the perspective of how you write code, as well as some more explanations of how the engine works. By the end of chapter 3, youā€™ll be set up, comfortable with the SDK, and ready to start building a Flutter app. If I did a good job, youā€™ll also understand whatā€™s under the hood.

Chapter 1. Meet Flutter

This chapter covers
  • What is Flutter?
  • What is Dart?
  • Why does Flutter use Dart?
  • When is Flutter the right tool (or the wrong tool)?
  • A brief intro to how Flutter works
Flutter is a mobile SDK, built and open sourced by Google; and at its core, itā€™s about empowering everyone to build beautiful mobile apps. Whether you come from the world of web development or native mobile development, Flutter makes it easier than ever to create mobile apps in a familiar, simplified way. Flutter is special in that it makes it truly possible to ā€œwrite once, and deploy everywhere.ā€ As of this writing, Flutter apps will deploy to Android, iOS, and ChromeOS. In the near future, Flutter apps will also run as web apps and desktop apps on all major operating systems.
In short, Flutter is a truly complete SDK for creating applications. Itā€™s a platform that provides everything you need to build applications: rendering engine, UI components, testing frameworks, tooling, router, and many more features. The consequence is that you get to focus on the interesting problems in your app. You can focus specifically on the domain functionality, and everything else is taken care of. The value that Flutter provides is astonishing.
In fact, thatā€™s how I found myself here, writing this book. I had to learn Flutter because of my job, and I loved it from the moment I started. I effectively became a mobile developer overnight, because Flutter felt so familiar to my web development background. (The Flutter team has said that they were influenced by ReactJS.)
Flutter isnā€™t only about being easy, though. Itā€™s also about control. You can build exceptional mobile apps using Flutter with a shallow knowledge of the framework. But you can also create incredible and unique features, if you so choose, because Flutter exposes everything to the developer.
This is a book about writing a (relatively) small amount of code and getting back a fully featured mobile app that works on iOS and Android. In the grand scheme, mobile app development is new. It can be a pain point for developers and companies alike. But I believe Flutter has changed that (and thatā€™s a hill Iā€™m willing to die on).
This books has one goal: to turn you into a (happy) Flutter (and Dart) developer.

1.1. Why does Flutter use Dart?

Flutter apps are written in the programming language called Dart. Iā€™ll describe Dart in depth throughout the book, but for now, just know that all the code you write in a Flutter app is Dart code. In fact, to us, the mobile developers, Flutter appears to be nothing more than a Dart library.
Dart is also owned and maintained by Google. This may give you pause. There are reasons to be skeptical of this choice: itā€™s not one of the hot languages of today, few companies use it in production, and the community must be small. What gives? Is Google just using it because itā€™s Googleā€™s language? I imagine that played a role, but there are practical reasons, too:
  • Dart supports both just-in-time (JIT) compiling and ahead-of-time (AOT) compiling:
    • The AOT compiler changes Dart into efficient native code. This makes Flutter fast (a win for the user and the developer), but it also means that (nearly) the entire framework is written in Dart. For you, the developer, that means you can customize almost everything.
    • Dartā€™s optional JIT compiling allows hot reloading to exist. Fast development and iteration is a key to the joy of using Flutter.
  • Dart is object-oriented. This makes it easy to write visual user experiences with Dart, with no need for a markup language.
  • Dart is a productive, predictable language. Itā€™s easy to learn, and it feels familiar. Whether you come from a dynamic language or a static language, you can get up and running with ease.
And I think Google owning Dart is an advantage. In the last few years, Dart has made great strides to be a nice language specifically for writing modern UIs. The type system and object orientation make it easy to reason about writing reusable components for the UI. And Dart includes a few functional programming features that make it easier to turn your data into pieces of UI. Finally, asynchronous, stream-based programming features are first-class citizens in Dart. These features are used heavily in reactive programming, which is the paradigm of today.
Lastly, Dart excels at being a language thatā€™s easy to learn. As a coworker of mine said about hiring, ā€œWe donā€™t have to find Dart people, only smart people.ā€

1.2. On Dart

Besides explaining Flutter in depth, I will also introduce the basics of Dart. Dart is a programming language. And programming languages can be, as it turns out, hard to learn. The fundamentals of Dart are similar to all higher-level languages. Youā€™ll find familiarity in Dart syntax if youā€™re coming from JavaScript, Java, or any other C-like language. Youā€™ll feel comfortable with Dartā€™s object-oriented design if youā€™re coming from Ruby or Python.
Like all languages, though, the devil is in the details (and, as they say, doubly in the bubbly). The joys of Dart and the complexity of writing good Dart code lie not in the syntax, but in the pragmatics.
Thereā€™s good news, though. Dart excels at being a ā€œsafeā€ language to learn. Google didnā€™t set out to create anything innovative with Dart. Google wanted to make a language that was simple and productive and that could be compiled into JavaScript. What Google came up with works well for writing UIs.
The fact that Flutter can compile to JavaScript is less relevan...

Table of contents