简体   繁体   中英

How to download image in flutter which comes through APIs?

Here I want to download image which comes through APIs in Flutter. I set edit image functionality and download that edited image. I mean I want to download image with set different widgets on image.

How to accomplish this in flutter?

You can use a Network image to display image Urls that are returned from an API:

const Image(
image: NetworkImage('YOUR IMAGE URL HERE'),
)

You can check; https://pub.dev/packages/flutter_downloader

Shortly:

final taskImage = await FlutterDownloader.enqueue(
  url: 'your url',
  savedDir: 'download path',
  showNotification: true, // Show download progress
  openFileFromNotification: true, // Click on notification to open file
);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM