download function
Download a File.
Implementation
Future<void> download(String endpoint, File target) async {
final client = HttpClient();
final request = await client.getUrl(Uri.parse(endpoint));
final response = await request.close();
await response.pipe(target.openWrite());
}