Flutter & Dart

Dart Apprentice: Beyond the Basics

Dart Apprentice: Beyond the Basics is the second of a two-book series that will teach you all the important concepts you need to master this powerful and versatile language. By Jonathan Sande.

Read for Free with the Personal Plan* * Includes this and all other books in our online library See all benefits
Buy Individually $59.99* *Includes access to all of our online reading features.
Leave a rating/review
Download materials
Buy paperback—Amazon Comments
Save for later
Share

Who is this for?

This book is for developers who are familiar with the basic Dart programming languages topics covered in Dart Apprentice: Fundamentals.

Covered concepts

  • String manipulation
  • Regular expressions
  • Anonymous functions
  • Object-oriented programming
  • Inheritance
  • Abstract classes
  • Interfaces
  • Mixins
  • Extension methods
  • Generics
  • Enhanced enums
  • Error handling
  • Concurrency
  • Futures
  • Streams
  • Isolates

Dart is an easy-to-learn yet powerful programming language. As one of the most versatile languages on the market today, you can use it to write anything from command-line apps and backend servers to native applications for Android, iOS, web, Mac, Windows and Linux. Dart was the language of choice for...

more

Before You Begin

This section tells you a few things you need to know before you get started, such as what you’ll need for hardware and software, where to find the project files for this book, and more.

Dart Apprentice: Beyond the Basics

1
Toggle description
In this chapter, you'll go beyond a basic understanding of strings and learn how to modify them to your needs. This includes basic tasks like capitalization, adding or removing whitespace, splitting and joining, and replacing text in a string. You'll also learn to validate strings and extract text using regular expressions.
2
Toggle description
Anonymous functions are functions without names. You can assign them to variables and pass them to and from other functions. In this chapter, you'll learn how to use anonymous functions with collections and as callback handlers.
3
Toggle description
In "Dart Apprentice: Fundamentals" you learned about classes. This chapter will take you beyond that to create a hierarchy of classes that share some base functionality. This is done through extending classes, which creates a parent-child or superclass-subclass relationship.
4
Toggle description
Abstract classes describe the general characteristics and behavior of a class without specifying the exact way that class is implemented. They're a key foundation to implementing the interfaces you'll learn about later.
5
Toggle description
Interfaces are similar to abstract classes in that they let you define the behavior you expect for all classes that implement the interface. They’re a means of hiding the implementation details of the concrete classes from the rest of your code.
Toggle description
Mixins are an interesting feature of Dart that you might not be familiar with, even if you know other programming languages. They’re a way to reuse methods or variables among otherwise unrelated classes.
Toggle description
Extension methods allow you to add functionality to existing classes. Even though they’re called methods, you can also add other members like getters, setters or even operators.
Toggle description
Generics refers to generalizing specific types like `String`, `bool` or `int` so you can handle them all the same way. This chapter will teach not only how to use generic types but also how to create new generic classes and collections.
Toggle description
Enums are more than just a set of named values. You can treat them like classes, even giving your enum properties and methods.
Toggle description
Try as you might, you can't stop from making mistakes when writing code. Debugging will help you find those mistakes. However, you also need to plan for and handle exceptional situations that could crash your app.
Toggle description
In this chapter, you'll learn to distinguish concurrency from parallelism. You'll also see how Dart implements concurrency with an event loop.
Toggle description
Dart's Future type is a promise to complete a task or give you a value in the future. They're ideal for potentially time-consuming operations like making a network request or reading from a database.
Toggle description
A future represents a single value that will arrive in the future, but a stream represents multiple future values. This chapter will teach you how to use, transform and even create streams from scratch.
Toggle description
Isolates allow you to run Dart code on multiple threads. This chapter will teach you to create short-lived isolates for single tasks and long-running isolates requiring two-way communication.