Book Image

Flutter for Beginners

By : Alessandro Biessek
Book Image

Flutter for Beginners

By: Alessandro Biessek

Overview of this book

Google Flutter is a cross-platform mobile framework that makes it easy to write high-performance apps for Android and iOS. This book will help you get to grips with the basics of the Flutter framework and the Dart programming language. Starting from setting up your development environment, you’ll learn to design the UI and add user input functions. You'll explore the navigator widget to manage app routes and learn to add transitions between screens. The book will even guide you through developing your own plugin and later, you’ll discover how to structure good plugin code. Using the Google Places API, you'll also understand how to display a map in the app and add markers and interactions to it. You’ll then learn to improve the user experience with features such as map integrations, platform-specific code with native languages, and personalized animation options for designing intuitive UIs. The book follows a practical approach and gives you access to all relevant code files hosted at github.com/PacktPublishing/Flutter-for-Beginners. This will help you access a variety of examples and prepare your own bug-free apps, ready to deploy on the App Store and Google Play Store. By the end of this book, you’ll be well-versed with Dart programming and have the skills to develop your own mobile apps or build a career as a Dart and Flutter app developer.
Table of Contents (21 chapters)
Free Chapter
1
Section 1: Introduction to Dart
5
Section 2: The Flutter User Interface - Everything is a Widget
10
Section 3: Developing Fully Featured Apps
15
Section 4: Advanced Flutter - Resources to Complex Apps

Introducing unit testing with Dart

In any language, we can write code that accomplishes some purpose; however, to write performant and bug-free code, we need to use every available resource we can.

Unit tests are one of the things that can help us to write modular, efficient, and bug-free code. The unit test is not the only way of testing code, of course, but it's a crucial part of testing small pieces of software in a manner that isolates it from other parts, helping us to focus on specific things.

Covering all of the application code with unit tests does not guarantee that it's 100% bug-free; however, it helps us to achieve mature code progressively, and this is one of the steps to ensuring a good development cycle, with stable releases from time to time.

Dart also provides some useful tools to work with tests; let's take a look at the starting point of unit testing...