0

I need to get the file size of the image that is a network image. I mean size in Kb, Mb, etc. How can I get it?

Jagal R Nath
  • 316
  • 5
  • 14

1 Answers1

3

You can get the size of the network Image by HTTP head request.

  http.Response r = await http.head(Uri.parse('https://i.stack.imgur.com/lkd0a.png'));
  print(r.headers["content-length"]); //545621 means 546 KB
Kishan Busa
  • 821
  • 6
  • 14