flutter

Convert a double to an int in Dart or Flutter

to convert a double value to int value you can use .toInt() method.

double _data = 2.0;
_data = _data.toInt();
Was this helpful?