Dart is a general purpose programming language developed by Google. You can use it to develop web, server, desktop and mobile applications for iOS & Android. It is pretty easy to learn (specially if you read this book), it is a very flexible language and has embraced the open source ecosystem. It is also very robust and has great tooling support.

If you are new to programming, Dart is a great option to start learning. If you are not, it is an easy to learn, powerful tool to add to your knowledge base. So there is little more to add.

In many ways Dart is a boring language, and that’s a good thing! It means that Dart is fast and easy to pick up. While Dart does have some unique characteristics, any knowledge you bring in from other object oriented or C-style languages will immediately be applicable. If you come here as a complete beginner to programming, Dart is a good place to start. The concepts that you’ll learn in this book will give you a solid foundation in your coding career.

Don’t let Dart’s mundane syntax fool you, though. Dart is a modern and rapidly evolving language, and the things it allows you to do are both exciting and even historic in nature. Never before have you been able to create native applications for so many platforms using a single code base.

There’s a good chance you picked up this book because of the Flutter UI framework. However, it was no accident that Flutter chose Dart as its language. The Dart virtual machine allows lightning fast development-time rebuilds, its JavaScript complier allows you to build for the web, and its ahead-of-time compiler creates fast native applications across mobile and desktop desktop platforms and even on the server and embedded devices.

It’s no wonder then that developers across the world have taken notice. The language has been climbing the charts for both fastest growing and most loved. The wise developer takes note of industry trends and joins them.

So welcome to this book!

Book sample projects

Each chapter comes with supplemental material. In the chapter folder you’ll find a folder called starter that contains a starter project with an empty main() function. You can either open this empty project in your editor by going to File ▸ Open in the menu, or just create a new project in the way you’ll learn in Chapter 1.

In addition to the starter project, chapters will also have a final folder and a challenge folder. You can refer to the final folder if you get lost during the lesson. It will contain the code from that lesson. Likewise, the challenge folder will contain the answers to the challenges at the end of every lesson as well as the mini-exercises throughout the lesson. You’ll learn the most if you don’t copy-and-paste this code but actually type it yourself.


You’ll often find mini-exercises in middle of a chapter after learning about some topic. These are optional but generally easy to complete. Like the challenges, they’ll help you solidify what you’re learning.


Challenges are an important part of Dart Apprentice. At the end of each chapter, the book will give you one or more tasks to accomplish that make use of the knowledge you learned in the chapter. Completing them will not only help you reenforce that knowledge but will also show that you’ve mastered it.

How to read this book

Each chapter of this book builds on the ones that precede it, so you’ll find it easiest to understand if you progress through the chapters in order.

Dart Apprentice was written with the beginner in mind. If that’s you, you’ll learn the most by following along and trying each of the code examples, mini-exercises and challenges as you come to them. The way to learn to code is by writing code and experimenting with it. That can’t be emphasized enough.

For more advanced readers who simply want to skim the content of this book to get up and running quickly, you’re welcome to. If that’s you, try the challenges at the end of every chapter. If they’re easy, move on to the next chapter. If they’re not, go back and read the relevant parts of the chapter and check the challenge solutions.

Finally, for all readers, raywenderlich.com is committed to providing quality, up-to-date learning materials. We’d love to have your feedback. What parts of the book gave you one of those aha learning moments? Was some topic confusing? Did you spot a typo or an error? Let us know at http://forums.raywenderlich.com and look for the particular forum category for this book. We’ll make an effort to take your comments into account in the next update of the book.

Have a technical question? Want to report a bug? You can ask questions and report bugs to the book authors in our official book forum here.
© 2023 Kodeco Inc.