Skip to content
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

A value of type 'Directory/*1*/' can't be assigned to a variable of type 'Directory/*2*/'. - 'Directory/*1*/' is from 'dart:io'. - 'Directory/*2*/' is from 'package:universal_io/src/io/directory.dart' #29

Open
amirsuwal01 opened this issue Feb 16, 2022 · 5 comments

Comments

@amirsuwal01
Copy link

No description provided.

@misterpropik
Copy link

this is because path_provider does not have web support

@ekuleshov
Copy link

this is because path_provider does not have web support

Don't think that is specific to the path_provider. Any API from a plugin declaring dependency on the File or Directory from the dart:io will choke when you try to pass values from univeral_io to them or try to assign values returned from such API to the variables typed from the universal_io.

E.g. in case of the path_provider, a workaround for non-web platforms is like:

Directory dir = Directory('${(await getApplicationSupportDirectory()).path}')

Though I wasn't been able to find a way to create a Directory instance on the web platform and would appreciate any help with that.

@Joseph-Nathan
Copy link

me to , any news .

@tanjunior
Copy link

You are importing the wrong dart.io on the other file. Make sure both uses the same.

@ekuleshov
Copy link

You are importing the wrong dart.io on the other file. Make sure both uses the same.

You can't make sure "both uses the same" when one of those imports is coming from some dependent 3rd party package that is not using the universal_io

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants