Integers and doubles are both number types, which means that both support many of the same methods and operators. Dart numbers work pretty much like they do in many other languages.
primitives/numbers.dart | |
| 2 + 2; // 4 |
| 2.2 + 2; // 4.2 |
| 2 + 2.2; // 4.2 |
| 2.2 + 2.2; // 4.4 |
As you can see, Dart numbers do “the right thing” when mixing them in operations.
18.223.170.223