如果我理解你的问题是正确的
_foodByCategories.where((a) {
var distance = new GreatCircleDistance.fromDegrees(latitude1: double.parse(widget.lat), longitude1: double.parse(widget.lng), latitude2: double.parse(a.lat), longitude2: double.parse(a.lng));
var totaldistance = distance.haversineDistance().toStringAsFixed(2);
double distanceDouble1 = double.parse(totaldistance);
return distance <= 30000; // or something like that
}).sort … // and your sorting code
</code>