-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The argument type 'File/*1*/' can't be assigned to the parameter type 'File/*2*/'. #19
Comments
Hi! Package |
Here's a workaround you can use for now (and maybe this will help lead you to the root cause @terrier989): Explicitly define the data type for your File as
|
There is a conflict between different file types.
and declare file variable as
|
I found the issue universal_io is working fine for me but Image.file is not universal so I used |
@bcgreijnlautier not working for me . if I use dynamic type , I get this error "Expected a value of type 'File', but got one of type '_File'". |
Perhaps this helps: I am trying to convert my firebase project to a web app. The conflict is the universal file vs. the FirebaseStorage dart.io and the following is where I get stuck:
My import is |
same problem , any news ? |
Assuming you are using XFile, there is a bug in |
This issue is still not fixed in the latest version i.e 2.0.4
flutter run -d chrome
Launching lib\main.dart on Chrome in debug mode...
lib/screens/myprofilescreen.dart:93:51: Error: The argument type 'File/1/' can't be assigned to the parameter type
'File/2/'.
('/D:/flutter/.pub-cache/hosted/pub.dartlang.org/universal_io-2.0.4/lib/src/io/file.dart').
: new FileImage(_imageFile),
^
lib/screens/CreatePostScreen.dart:163:46: Error: The argument type 'File/1/' can't be assigned to the parameter type
'File/2/'.
('/D:/flutter/.pub-cache/hosted/pub.dartlang.org/universal_io-2.0.4/lib/src/io/file.dart').
child: _image != null ? Image.file(_image) : null,
^
lib/screens/EditPostScreen.dart:155:46: Error: The argument type 'File/1/' can't be assigned to the parameter type
'File/2/'.
('/D:/flutter/.pub-cache/hosted/pub.dartlang.org/universal_io-2.0.4/lib/src/io/file.dart').
child: _image != null ? Image.file(File(_image.path)) : null,
The text was updated successfully, but these errors were encountered: