Found 56 Articles for Dart Programming

Bitwise operators in Dart Programming

Mukul Latiyan
Updated on 21-May-2021 12:26:03

3K+ Views

Bitwise operators are operators that are used to perform bit-level operations on operands. For example, consider two variables x and y where the values stored in them are 20 and 5 respectively.The binary representation of both these numbers will look something like this −x = 10100 y = 00101We make use of all the bitwise operators in Dart to perform on the values that are shown in the above table (bit values).In the below table all the bitwise operators that are present in Dart are mentioned.Consider the table as a reference.OperatorMeaningExampleDescription&Binary AND( x & y )Will produce 00100|Binary OR( x | ... Read More

Async and Await in Dart Programming

Mukul Latiyan
Updated on 21-May-2021 12:27:02

1K+ Views

Async and Await keywords are used to provide a declarative way to define the asynchronous function and use their results.The async keyword is used when we want to declare a function as asynchronous and the await keyword is used only on asynchronous functions.Syntaxvoid main() async { .. }If the function has a declared return type, then update the type of the Future to the return type.Future main() async { .. }And finally, we make use of await keyword when we want to wait for the asynchronous function to finish.await someAsynchronousFunction()ExampleLet's consider an example where we are declaring the main function ... Read More

Assignment operators in Dart Programming

Mukul Latiyan
Updated on 21-May-2021 13:16:05

982 Views

We make use of assignment operators whenever we want to assign values to a variable. There are times when we combine assignment operators with arithmetic operators and logical operators to build a shorthand version of both the assignment and arithmetic (or logical) expression. These shorthand versions are also known as compound statements.In the table below, all the assignment operators that are present in dart are mentioned.Consider the table shown below −OperatorDescriptionExpression=Assignment operatora = b+=Add and assign combineda += b is equivalent to a = a + b-=Subtract and assigna –= b is equivalent to a = a - b*=Multiply and ... Read More

Arithmetic operators in Dart Programming

Mukul Latiyan
Updated on 21-May-2021 13:18:14

786 Views

Arithmetic operators are used to perform different arithmetic operations.These arithmetic operations mainly are −AdditionSubtractionMultiplicationDivisionModulus, etc.Let's consider that we have two int variables named x and y, where x is storing the value 10 and y is storing the value 20.In the below table, you can see all the arithmetic operators, with their symbol, name, what output they yield etc.Consider the table shown below −OperatorNameDescriptionOutput+AdditionAddition of two or more operandsx + y = 30-SubtractionSubtraction of the second operand from the firstx - y = -10*MultiplicationMultiplication of two or more operandsx * y = 200/DivisionReturns quotient after divisionx / y = 0.5%ModulusReturns ... Read More

Anonymous function in Dart Programming

Mukul Latiyan
Updated on 21-May-2021 12:34:45

735 Views

A function without a name is known as an anonymous function. They behave in the exact same manner as a normal named function would. The only difference between the named and an anonymous function is how different they are in syntax.Anonymous functions are used in Dart to form closures. An anonymous function contains a self-contained block of codes, also it can be passed as a parameter to another function as well.Anonymous function Syntax(parameterList){    // inner statement(s) }ExampleNow, let's consider a simple example of an anonymous function.Consider the example shown below − Live Demovoid main() {    var fruits = ["Apple", ... Read More

Abstract Classes in Dart Programming

Mukul Latiyan
Updated on 21-May-2021 12:16:33

2K+ Views

Abstract classes in Dart are classes that contain one or more abstract methods.Note: Abstract methods are those methods that don't have any implementation.It should also be noted that a class in Dart can be declared abstract using the "abstract" keyword followed by the class declaration. A class that is declared using the abstract keyword may or may include abstract methods.An abstract class is allowed to have both the abstract methods and concrete methods (methods with implementation). Though, on the contrary, a normal class (non-abstract class) cannot have abstract methods.An abstract class is mainly used to provide a base for subclasses to extend and ... Read More

Advertisements