if location cal error, print default distance
This commit is contained in:
@@ -26,10 +26,15 @@ class _MihBusinessProfilePreviewState extends State<MihBusinessProfilePreview> {
|
|||||||
PlatformFile? file;
|
PlatformFile? file;
|
||||||
|
|
||||||
String calculateDistance() {
|
String calculateDistance() {
|
||||||
double distanceInKm = MIHLocationAPI().getDistanceInMeaters(
|
try {
|
||||||
widget.myLocation!, widget.business.gps_location) /
|
double distanceInKm = MIHLocationAPI().getDistanceInMeaters(
|
||||||
1000;
|
widget.myLocation!, widget.business.gps_location) /
|
||||||
return "${distanceInKm.toStringAsFixed(2)} km";
|
1000;
|
||||||
|
return "${distanceInKm.toStringAsFixed(2)} km";
|
||||||
|
} catch (error) {
|
||||||
|
print(error);
|
||||||
|
return "*.** km";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
Reference in New Issue
Block a user