Dart – Getters and Setters

Getters and Setters, also called accessors and mutators, allow the program to initialize and retrieve the values of class fields respectively.  Getters or accessors are defined using the get keyword. Setters or mutators are defined using the set keyword. A default getter/setter is associated with every class. However, the default ones can be overridden by explicitly defining a setter/ getter.… Continue reading Dart – Getters and Setters

Dart – If-else Statement

In Dart, if-block is executed when the given condition is true. If the given condition is false, else-block is executed. The else block is associated with the if-block. Dart if…else Statement Flow Diagram Syntax: Here, if -else statement is used for either types of result TRUE or False. If the given condition evaluates true, then… Continue reading Dart – If-else Statement

Dart – Class

In object-oriented programming, a class is a blueprint for creating objects. A class defines the properties and methods that an object will have. Declaring Class In Dart You can declare a class in dart using the class keyword followed by class name and braces {}. It’s a good habit to write class name in PascalCase.  Syntax: The class keyword is… Continue reading Dart – Class

Dart – Keywords

Dart Keywords are the reserve words that have special meaning for the compiler. It cannot be used as the variable name, class name, or function name. Keywords are case sensitive; they must be written as they are defined.  There are 61 keywords in the Dart. Some of them are common, you may be already familiar and few… Continue reading Dart – Keywords

Dart – Null Safety

Null safety prevents errors that result from unintentional access of variables set to null. Nullable Types (?) : To specify if the variable can be null, then you can use the nullable type  operator. You don’t need to initialize a nullable variable before using it. It is initialized to null by default. The Assertion Operator (!) :… Continue reading Dart – Null Safety

Dart – Map

Maps Maps is an unordered pair of key and values. The keys of the map must unique, values can be the same. Map is also called dictionary or hash .The size of a map is not fixed, we can add, delete edit the values of the map. The size of the map depends upon the number of elements in… Continue reading Dart – Map

Published
Categorized as Dart Tagged

Dart – Set

Set A set is an unordered collection of values. We can’t get the values by their index values as they are unordered. Values in set are unique i.e. they can’t be repeated. Creating a Set using a constructor: Creating a Set using List Inserting elements in Set

Published
Categorized as Dart Tagged

Dart – List

List A list is an array of elements arranged in an ordered sequence. There are two types of List: Fixed-Length List Growable List Fixed-Length List is a list that can’t be changed once initialized whereas the Growable list is dynamic in nature. Fixed-length List Creating a Fixed-length List The indexing value start with 0 and end with listOfLength-1 .… Continue reading Dart – List

Published
Categorized as Dart Tagged