Closed jvapps21 closed 4 years ago
After number of days searching and learning flutter i found solution Using Path Provider Package
RaisedButton( child: Text("Download Image"),
onPressed: () async {
final Fname = "image_1";
final ByteData bytes = await rootBundle.load('assets/images/' + Fname);
final buffer = bytes.buffer;
var dir = await getTemporaryDirectory();
File(dir.path+"/"+Fname).writeAsBytes(buffer.asUint8List(bytes.offsetInBytes, bytes.lengthInBytes));
final fpath = dir.path.toString() + "/" + Fname;
print("stored Path ===>"+fpath);
}
)
You can also give your own specific path too for stored assets folder / Url image as well
i want to download image from assets: folder image . how can do this using your library?. currently it just download image from URL only ..