Sitemap
Dart Tutorials

Dart Tutorials for beginners and advanced programmers

Member-only story

Operators in Dart

--

Operators in Dart are special symbols that perform operations on variables and values. They allow manipulation of data and control of flow within a program. Dart provides several types of operators:

Press enter or click to view image in full size

Read Medium Story for free 👇

1. Arithmetic Operators

Arithmetic operators are used to perform mathematical calculations.

  • + (Addition): Adds two operands.
  • - (Subtraction): Subtracts second operand from the first.
  • * (Multiplication): Multiplies two operands.
  • / (Division): Divides first operand by the second (returns a double).
  • ~/ (Integer Division): Divides first operand by the second (returns an integer, discarding the remainder).
  • % (Modulo): Returns the remainder of division.
  • ++ (Increment): Increases a value by 1.
  • -- (Decrement): Decreases a value by 1.
void main() {
int a = 10;
int b = 3;
print(a + b); // Output: 13
print(a / b); // Output…

--

--

Usama Sarwar
Usama Sarwar

Written by Usama Sarwar

Helping founders turn ideas into market-ready web and mobile apps within 30 days using Google’s Flutter & Next.js without juggling multiple teams.

Dart Tutorials
Dart Tutorials

Published in Dart Tutorials

Dart Tutorials for beginners and advanced programmers