Provider: BuildContext defined in Provider?

Created on 19 Aug 2020  路  2Comments  路  Source: rrousselGit/provider

I'm using Provider log time, but recently due to reason not important here I tried to upgrade to latest version of Provider (from 3.1.0+1 to 4.3.2), but I couldn't do it because of error:

error: The name 'BuildContext' is defined in the libraries 'package:flutter/src/widgets/framework.dart (via package:flutter/widgets.dart)' and 'package:provider/src/provider.dart (via package:provider/provider.dart)'. (ambiguous_import at [XXXX] lib\X\X\X.dart:74)

Is that expected?
Should I use prefix for Provider?

I have 191 errors like that.

bug

Most helpful comment

You are correct, cleaning, pub get, and restart Android Studio fixed the issue.

Thank you.

All 2 comments

There is nothing named "BuildContext" exported by provider

Maybe try a flutter clean and flutter pub get

You are correct, cleaning, pub get, and restart Android Studio fixed the issue.

Thank you.

Was this page helpful?
0 / 5 - 0 ratings