unpub icon indicating copy to clipboard operation
unpub copied to clipboard

feat: change downloadUrl to future

Open amondnet opened this issue 2 years ago • 1 comments

If the downloadUrl is future, it will be helpful when implementing other package stores.

For example, I am using gcloud for package store.

  @override
  FutureOr<String> downloadUrl(String name, String version) async {
    var object = await _bucket.info('$name-$version.tar.gz');
    final url = object.downloadLink.toString();
    return url;
  }

amondnet avatar Oct 18 '21 05:10 amondnet

I recommend using FutureOr<String> instead of Future<String> so it is more flexible and does not break existing implementations

danilofuchs avatar Oct 21 '21 20:10 danilofuchs