Line data Source code
1 : import './SearchData.dart'; 2 : import '../geocoder_offline.dart'; 3 : 4 : class LocationResult { 5 : /// Location data that was finded in search. Contains data from provided search file. 6 : LocationData location; 7 : 8 : /// Search data contains latitude and longitude that was searched for. 9 : SearchData searchData; 10 : 11 : /// Distance beetween search data and location data 12 : double distance; 13 : 14 : /// Bearing beetween search data and location data 15 : String bearing; 16 : 17 1 : LocationResult(this.location, this.distance, this.bearing, this.searchData); 18 : 19 : /// Get LocationResult representation in GNIS format 20 1 : String get gnisFormat { 21 2 : if (distance < 1) { 22 5 : return '${location.featureName}, ${location.state} '; 23 : } 24 8 : return '${distance.toInt()}mi $bearing of ${location.featureName}, ${location.state} '; 25 : } 26 : }