我实际上是在尝试将拍摄的图像转换ImagePicker为base64图像.我总是得到错误.
FileSystemException: Cannot open file, path =
'file:///storage/emulated/0/Download/Abid_Wipro_neemuchwala1-
770x433.jpg' (OS Error: No such file or directory, errno = 2)
E/flutter ( 5042): #0 _File.throwIfError
(dart:io/file_impl.dart:628)
E/flutter ( 5042): #1 _File.openSync
(dart:io/file_impl.dart:472)
E/flutter ( 5042): #2 _File.readAsBytesSync
(dart:io/file_impl.dart:532)
Run Code Online (Sandbox Code Playgroud)
我正在使用的代码是这个.
File fileData;
/////////////...........
new Container(
child: new FutureBuilder<File>(
future: imageFile,
builder: (BuildContext context, AsyncSnapshot<File> snapshot) {
if (snapshot.connectionState == ConnectionState.done &&
snapshot.data != null) {
fileData = snapshot.data;
return new Container(
height: MediaQuery.of(context).size.height / 2,
width: MediaQuery.of(context).size.width,
margin: …Run Code Online (Sandbox Code Playgroud)