jimina
jimina

Reputation: 1

The package 'pin_code_fields' isn't a dependency of the importing package. Try adding a dependency for 'pin_code_fields' in the 'pubspec.yaml' file

Does anyone have a solution for this?

flutter image

I typed all the following commands in the terminal but nothing.

"flutter package get "

"flutter packages upgrade"

"flutter pub get"

"flutter pub add flutter_pin_code_fields". I added " flutter_pin_code_fields: ^2.2.0 I added "flutter_pin_code_fields: ^2.2.0" to the dependencies in File < pubspec.yaml > , saved and restarted the IDE, which is VScode.

Upvotes: 0

Views: 143

Answers (2)

Barzi Yassin
Barzi Yassin

Reputation: 206

In "pubspec.yaml": (manually)

  • ✔ You have to add the package to
dependencies:
  package_name: vesion
  • ✖ And not to
dev_dependencies: 
  package_name: version

In terminal:

  • you can add packages to dependencies through this command:
flutter pub add package_name
  • then, refreshing dependencies if needed:
flutter clean
flutter pub get
flutter run

Upvotes: 0

Aizan Sagheer
Aizan Sagheer

Reputation: 1672

If you add a package by this command

flutter pub add flutter_pin_code_fields

then you don't need to do this manually in your file pubspec.yaml like this

dependencies:
  flutter_pin_code_fields: ^2.2.0

After running a command or adding manually in pubspec.yaml, do this:

flutter clean
flutter pub get
flutter run

Upvotes: 0

Related Questions