Jay Dangar
Jay Dangar

Reputation: 3479

Question regarding flutter packages and its dependencies

Is it okay to use packages from pub.dev extensively? Is it advisable to not use it or use it as few as possible? Also while using flutter packages from pub.dev, It shows dependencies on which those packages are relied on, so do I need to import those "dependent" packages again? see the image for more info.

Sample Dependency

Upvotes: 0

Views: 858

Answers (2)

Prashanth S.
Prashanth S.

Reputation: 420

  • While using a package from pub.dev you can see it's repository in Github, check starts, issues and verify the package yourself.
  • Use external packages only if required. Anyways some package may have implemented the feature efficiently, in that case, it's better to use the package rather than writing on your own.
  • The dependencies mentioned in the package are already imported to that package, hence you won't need to import it again

Upvotes: 2

neohaojun
neohaojun

Reputation: 312

  1. It is ok to use pub.dev packages, but doing so may slow your app down, hence it is recommended to use your own code unless it is an extremely long and repetitive task that can be simplified by the package.
  2. When using packages from pub.dev, it is not necessary to import the dependencies the package relies on. The installation instructions should be under the 'Installing' section - in this case, you should be adding easy_localization: ^2.3.2 in your pubspec.yaml file.

Upvotes: 2

Related Questions