Dart Tutorials: Advanced Fatures

🎯 Dart (DartLang) Introduction: Advanced Dart Features

In this article, we will look at some of the advanced features of Dart which you can live without but they empower our Dart program and help us achieve some tough goals.

Uday Hiwarale
RunDart
Published in
6 min readOct 7, 2019

--

Immutability

A value is immutable when it can not be modified. Do not get confused with variables. If a variable has a value and we assign a different value, then we did not change the value, we just assigned a new value to the variable.

A value is immutable when its internal structure can not be modified. For example, a Person object can have name property. We can assign a new value to person.name and by doing that, we are changing the internal state of the object. This is called object mutation and person is a mutable object.

In certain cases, we need immutable objects. Immutable object, after they defined, can not be changed. In earlier articles, we learned about final and const. Since we know that, by making instance variables of a class final, those properties can not be changed after assigned some initial value.

--

--