显示总共113条中的前3条
Unhandled Exception: type 'double' is not a subtype of type 'Double?'
发布者 : 粮油菜大市场 发布时间 : 01 Dec 2021 02:32:13
Unhandled Exception: type 'double' is not a subtype of type 'Double?'
声明类型的时候 应该是 double? xxx ,
flutter CachedNetworkImage image can't update cache
发布者 : 粮油菜大市场 发布时间 : 29 Nov 2021 15:32:25
Future _deleteImageFromCache() async {
String url = "your url";
await CachedNetworkImage.evictFromCache(url);
}
https://stackoverflow.com/questions/57059306/how-to-clear-cache-in-cachednetworkimage-flutter
cached_network_image
大概可能是这个插件不使用默认的cache了,用他自定义的cache清除函数
flutter dio upload image type application/octet-stream to image/jpeg
发布者 : 粮油菜大市场 发布时间 : 29 Nov 2021 06:56:02
MediaType? mediaType; if (_fileToUpload.path.endsWith('jpg') || _fileToUpload.path.endsWith('jpeg')) { mediaType = MediaType("image", "jpeg"); } else if (_fileToUpload.path.endsWith('png')) { mediaType = MediaType("image", "png"); } if (_fileToUpload.path.isNotEmpty) { // Create a FormData String fileName = basename(_fileToUpload.path); print("File Name : $fileName"); print("File Size : ${_fileToUpload.lengthSync()}"); print("File Type : $mediaType"); _formData = FormData.fromMap({ "product_images": await MultipartFile.fromFile(_fileToUpload.path, filename: fileName, contentType: mediaType) }); }解决方案就是更改contentType参数