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
Category: Dart
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 – Variable
Variable is used to store the value and refer the memory location in computer memory. When we create a variable, the Dart compiler allocates some space in memory. The size of the memory block of memory is depended upon the type of variable. To create a variable, we should follow certain rules. Here is an… Continue reading Dart – Variable
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
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
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
Dart – Iterable
Iterable Iterable is an extract class, it can’t de instantiate directly. An Iterable of string and int The difference with List and Iterable is that that element in the list can be accessed with their index value using [] operator while in Iterable value can’t be accessed using [] operator. If we run the above program. We get the… Continue reading Dart – Iterable