Assignment operators are used in flutter to assign right side operand value to left side operand. The basic assignment operator in flutter is =(Equal). Equal is assign right side value to left side operand without any modification. There are basically 12 Assignment operators available in Dart including Bitwise operators. So in this tutorial we would learn about List of All Assignment Operators in Dart Flutter with Example Tutorial.
Contents in this project List of All Assignment Operators in Dart Flutter with Example:
S.NO. | Operator Sign | Operator Name |
1 | = | Normal assignment |
2 | += | Addition assignment |
3 | -= | Subtraction assignment |
4 | *= | Multiplication assignment |
5 | /= | Division assignment |
6 | %= | Modulo assignment |
7 | ~/= | Integer division assignment |
8 | >>= | Bitwise shift right assignment |
9 | <<= | Bitwise shift left assignment |
10 | ^= | Bitwise XOR assignment |
11 | &= | Bitwise AND assignment |
12 | |= | Bitwise OR assignment |
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
void main() { var a, b; a = 10 ; b = 20 ; a = b ; print(a); a += b ; print(a); a -= b ; print(a); a *= b ; print(a); a /= b ; print(a); a %= b ; print(a); a ~/= b ; print(a); a >>= b ; print(a); a <<= b ; print(a); a ^= b ; print(a); a &= b ; print(a); a |= b ; print(a); } |
Output:
Also Read:
Flutter Dart List of All Arithmetic Operators with Example Tutorial
Show Divider Between ListView ListTile Items in Flutter
Flutter Dart Create Call Fat Arrow One Line Function Example Tutorial
Clear Build Cache in Flutter Android iOS App and Rebuild Project
Flutter Column MainAxisAlignment Properties Explained with Example