📌  相关文章
📜  将网络图像保存到本地目录 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:20.895000             🧑  作者: Mango

代码示例1
var response = await http.get(imgUrl);
Directory documentDirectory = await getApplicationDocumentsDirectory();
File file = new File(join(documentDirectory.path, 'imagetest.png'));
file.writeAsBytesSync(response.bodyBytes); // This is a sync operation on a real 
                                           // app you'd probably prefer to use writeAsByte and handle its Future