I had the numberpicker 2.1.2 package installed in my app, for some weeks now, until I accidentally deleted it from my dart packages. I have since been trying to run "flutter pub add numberpicker". When I run this command, the numberpicker: ^2.1.2 is inserted in my pubspec.yalm file and it's dependent package infinite_listview-1.1.0 is installed and appears in Dart Packages. But numberpicker doesn't. If I run pub get it says the package is in the dependencies but it's not appearing. and the error Target of URI doesn't exit 'import 'package:numberpicker/numberpicker.dart'; persists. How do I solve this?
I have tried : (1)removing the numberpicker: ^2.1.2 from pubspec.yalm file and re run "flutter pub add numberpicker" to no avail. (2) I have also tried downgrading and later upgrading flutter to no avail.
I solved it by running flutter pub cache repair