Sitemap
Gökhan VARIŞ

Gökhan VARIŞ

IOS & Flutter Developer

Dart Operators

3 min readJan 15, 2023

--

Press enter or click to view image in full size

Dart Operators

In order to perform certain operations on the operands, the operators are special symbols. Numerous built-in operators on the Dart can be used to perform a variety of tasks.

Different sorts of Dart operators
The several categories of operators in Dart are as follows:

  1. Arithmetic Operators
  2. Relational Operators
  3. Type Test Operators
  4. Bitwise Operators
  5. Assignment Operators
  6. Logical Operators
  7. Conditional Operator
  8. Cascade Notation Operator

Arithmetic Operators:

This group of operators includes those that are used to add, subtract, multiply, or divide operands. They operate on two operands since they are binary operators. They go as follows:

+ Addition : to combine two operands.

- Subtraction: Utilize to remove two operands.

-expr Unary Minus: Reversing the expression’s sign is a common practice.

* Multiply: to multiply two operands.

/ Division: to divide two operands.

~/ Division: Use two divide two operands but give output in integer.

% Modulus: Utilize to provide the remainder of two operands.

Relational Operators:

These operators are included in this class because they are used to carry out relational operations on the operands. It goes as follows:

> Greater than: As a boolean expression, determine which operand is larger.

< Less than: Find the smallest operand and output the result as a boolean expression.

>= Greater than or equal to: As a boolean expression, determine whether operand is bigger or equal to the other.

<= less than equal to: As a boolean expression, determine which operands are less than or equal to one another.

Get Gökhan VARIŞ’s stories in your inbox

Join Medium for free to get updates from this writer.

== Equal to: Test the equality of the operands and output the result as a boolean expression.

!= Not Equal to: The operands are checked to see if they are equal to one another and the result is provided as a boolean expression.

Type Test Operators:

The operators used to compare the operands are included in this class of operators. It goes as follows:

is : if an object is of a certain type, it outputs a boolean value of true.

is! : If an object is of a certain type, it outputs the boolean value false.

Bitwise Operators:

The bitwise operators used to operate on the operands are included in this class of operators. It goes as follows:

& : Performs bitwise and operation on two operands.

| : Bitwise ORPerforms bitwise or operation on two operands.

^ : Bitwise XORPerforms bitwise XOR operation on two operands.

~ : Bitwise NOTPerforms bitwise NOT operation on two operands.

<< : Left ShiftShifts a in binary representation to b bits to left and inserting 0 from right.

>> : Right ShiftShifts a in binary representation to b bits to left and inserting 0 from left.

Assignment Operators:

These operators are included in this class because they are used to give operands values. It goes as follows:

= : Use to give the expression or variable values.

??= : Operational operator If it is null, only assign the value.

Logical Operators:

This group of operators includes those that are employed to logically combine two or more operand circumstances. It goes as follows:

&& : Use to combine two conditions, returning true if both are met.

|| : Use to combine two criteria, returning true if even one of them is true.

! : It is used to change the outcome(reverse).

Conditional Operators:

condition ? expersion1 : expersion2 : It is a straightforward if-else statement. If the condition is met, then experiment 1 is carried out; otherwise, experiment 2 is carried out.

expersion1 ?? expersion2 : If expression1 is not null, it returns its value; otherwise, expression2’s value is returned.

Cascade Notation Operators:

With this group of operators, you can carry out a series of operations on the same element. You are able to use many methods on the same object. It goes as follows:

.. : Multiple methods can be applied to the same object using it.

--

--