Dart Switch case statement is used to avoid the long chain of the if-else statement. It is the simplified form of nested if-else statement. The value of the variable compares with the multiple cases, and if a match is found, then it executes a block of statement associated with that particular case. The assigned value… Continue reading Dart Switch Case Statement
Tag: dart
Core libraries: Dart
Dart has a rich set of core libraries that provide essentials for many everyday programming tasks such as working on collections of objects (dart:collection) , making calculations (dart:math), and encoding/decoding data (dart:convert). Multi-platform libraries. The following table lists the Dart core libraries that work on all Dart Platform. dart:coreBuilt-in types, collections, and other core functionality… Continue reading Core libraries: Dart
Dart – Loop Control Statements (Break and Continue)
Dart supports two types of loop control statements: Break Statement Continue Statement Break Statement: This statement is used to break the flow of control of the loop i.e if it is used within a loop then it will terminate the loop whenever encountered. It will bring the flow of control out of the nearest loop.… Continue reading Dart – Loop Control Statements (Break and Continue)
How to Replace a Substring of a String in Dart?
To replace all the substring of a string we make use of replaceAll method in Dart. This method replaces all the substring in the given string to the desired substring. Returns a new string in which the non-overlapping substrings matching from (the ones iterated by from.allMatches(this String)) are replaced by the literal string replace. Syntax:… Continue reading How to Replace a Substring of a String in Dart?
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 – If Statements
If statement allows us to a block of code execute when the given condition returns true. In Dart programming, we have a scenario where we want to execute a block of code when it satisfies the given condition. The condition evaluates Boolean values TRUE or FALSE and the decision is made based on these Boolean… Continue reading Dart – If Statements
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 – 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