Dart was traditionally designed to create single-page applications. And we also know that most computers, even mobile platforms, have multi-core CPUs. To take advantage of all those cores, developers traditionally use shared-memory threads running concurrently. However, shared-state concurrency is error-prone and can lead to complicated code. Instead of threads, all Dart code runs inside of… Continue reading Concept of Isolates in Dart
Category: Dart
Fall Through Condition in Dart
Fall through is a type of error that occurs in various programming languages like C, C++, Java, Dart …etc. It occurs in switch-case statements where when we forget to add break statement and in that case flow of control jumps to the next line. “If no break appears, the flow of control will fall through… Continue reading Fall Through Condition in 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 – Runes
Dart represents strings as a sequence of Unicode UTF-16 code units. Unicode is a format that defines a unique numeric value for each letter, digit, and symbol. A rune is an integer representing a Unicode code point. The String class in the dart:core library provides mechanisms to access runes. String code units / runes can be accessed in three ways… Continue reading Dart – Runes
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 Exceptions
An exception (or exceptional event) is a problem that arises during the execution of a program. Sr.No Exceptions & Description 1 DeferredLoadException Thrown when a deferred library fails to load. 2 FormatException Exception thrown when a string or some other data does not have an expected format and cannot be parsed or processed. 3 IntegerDivisionByZeroException… Continue reading Dart Exceptions