formatDistance method
格式化距离
Implementation
String formatDistance() {
final distance = round();
if (distance < 1000) {
return '${distance}m';
} else {
return '${(distance / 1000).toStringAsFixed(1)}km';
}
}
格式化距离
String formatDistance() {
final distance = round();
if (distance < 1000) {
return '${distance}m';
} else {
return '${(distance / 1000).toStringAsFixed(1)}km';
}
}