O'Reilly logo

Learning Dart by Ivo Balbaert, Dzenan Ridjanovic

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Built-in types and their methods

Like Ruby, Dart is a purely object-oriented (OO) language, so every variable in Dart points to an object and there are no primitive types as in Java or C#. Every variable is an instance of a class (that inherits from the base class Object) and has a type, and when uninitialized has the value null. But for ease-of-use Dart has built-in types for numbers, Booleans, and strings defined in dart:core, that look and behave like primitive types; that is, they can be made with literal values and have the basic operations you expect (to make it clear, we will use full typing in builtin_types.dart, but we could have used var as well).

A String (notice the capital) is a sequence of Unicode (UTF-16) characters, for example: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required