Author: saqibkhan
-
Async
Dart Async is related to asynchronous programming. It executes the asynchronous operation in a thread. It ensures that the critical functions to be executed until completion. The asynchronous operation is executed, separately the main application thread. In Dart, one operation cannot interrupt the other operation; it means one operation can execute at a time no…
-
Isolates
Dart allows us to asynchronous programming which runs our program without getting blocked. The asynchronous programming is used to achieve concurrency. Dart isolate is a version of the thread. But there is key difference between the common implementation of “Thread” or “Isolates”. The isolate works differently in comparison of Thread. The isolates are independent workers that do not…
-
Callable Classes
Dart provides the facility to call class instances like a function. To make callable class, we need to implement a call() method in it. Let’s understand the following example – Example – 1 Output Explanation: In the above code, We defined a call() function in the class Student that takes two arguments String name, integer age and…
-
Generators
Dart Generator is a unique function that allows us to produce a sequence of values. Generators return values on demand; it means the value is generated when we try to iterate over the iterators. Dart provides built-in support for two types of generator functions. Synchronous Generator It returns an iterable object which carries value synchronously.…
-
Libraries
In Dart, the library is the collection of the routine or set of programming instructions. Dart consists of many sets of built-in libraries that are beneficial to hold routines (functions, set of classes, etc.), and regularly used. A Dart library contains constants, functions, properties, exceptions, and typedefs, and set of classes. Importing a library To…
-
Packages
Dart package is the collection of a well-organized, independent, and reusable code unit. Applications might be needed to implement third-party libraries or packages. The package generally contains a set of classes, functions, or unit of code for specific tasks along with the compiled program and sample data. Dart provides an extensive set of default packages…
-
Generics
Dart Generics are the same as the Dart collections, which are used to store the homogenous data. As we discussed in the Dart features, it is an optionally typed language. By default, Dart Collections are the heterogeneous type. In other words, a single Dart collection can hold the values of several data types. However, a Dart…
-
Collection
Dart doesn’t support the array to store the data, unlike the other programming language. We can use the Dart collection in place of array data structure. We can enable the other classes of the collection in our Dart script by using the dart::core library. Dart collection can be classified as follows. Dart Collection Description List…
-
Typedef
In Dart, the typedef is used to generate an alias for function type that we can use it as type annotation for declaring variables and return types of that function type. An alias of function type can be used as type annotation in variable declaration or function return type. A typedef stores the type information…
-
Exceptions
Dart Exceptions are the run-time error. It is raised when the program gets execution. The program doesn’t report the error at compile time when the program runs internally and if Dart compiler found something not appropriate. Then, it reports run-time error and the execution of program is terminated abnormally. This type of error is called…