Flutter for Beginners
上QQ阅读APP看书,第一时间看更新

Increment and decrement operators

The increment and decrement operators are also common operators and are implemented in number type, as follows:

  • ++var or var++ to increment 1 into var
  • --var or var-- to decrement 1 from var

The Dart increment and decrement operators don't have anything different to typical languages. A good application of increment and decrement operators is for count operations on loops.