Skip to content

The type of 'xProvider' can't be inferred because it depends on itself through the cycle #3084

Closed Answered by rrousselGit
shahmirzali49 asked this question in Q&A
Discussion options

You must be logged in to vote

You have a circular dependency on your provider.
This causes Dart's type inference to fail.

You can fix the type-inference issue by explicitly typing your providers:

final Provider<int> provider = Provider<int>(...);

Note that circular dependencies are not allowed. Chances are you'd get a runtime exception when fixing that Dart error if you did indeed have a circular dependency

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@shahmirzali49
Comment options

Answer selected by shahmirzali49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants