In my opinion this library would be way more dart-alike if you would use Futures instead of callback functions.
Example of what I have to do:
Future<LatLng> getLatLngFromString(String address) {
var completer = new Completer<LatLng>();
_geocoder.geocode(
new GeocoderRequest()
..address = address,
(results, status) => status == GeocoderStatus.OK
? completer.complete(results[0].geometry.location)
: completer.completeError(
'Geocode was not successful for the following reason: ' +
status.toString()));
return completer.future;
}
It would be better if Futures would be returned directly.
In my opinion this library would be way more dart-alike if you would use Futures instead of callback functions.
Example of what I have to do:
It would be better if Futures would be returned directly.