Chapter 3. Working with Data Types

In this chapter, we will cover the following recipes:

  • Concatenating strings
  • Using regular expressions
  • Strings and Unicode
  • Using complex numbers
  • Creating an enum
  • Flattening a list
  • Generating a random number within a range
  • Retrieving a random element from a list
  • Working with dates and times
  • Improving performance in numerical computations
  • Using SIMD for enhanced performance

Introduction

This chapter is about working with the different data types Dart has to offer. The basic data types available are var (stores any object); num (stores any number type); int, double, String, bool, List (arrays); and Map (associative arrays). All of these data types are declared in the dart:core library. We will talk about strings, random numbers, complex numbers, dates and times, enums, and lists. We will cover a lot of tricks to help you out in specific circumstances. To get a quick overview of all the data types in Dart, refer to https://www.dartlang.org/docs/dart-up-and-running/contents/ch02.html#built-in-types.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset