Member-only story
The pros and the cons

In this article I’ll be referring to Flutter and Dart packages, but the principles apply across languages and frameworks.
There’s a package for that
When you’re just getting started building a new application in a new language and framework, everything is fresh and exciting — but it’s also difficult. How do you navigate to the next screen? How do you make a server request? How do you update the UI when the result comes back? How do you store data locally? How do you access the camera? Every new task brings a daunting list of new questions.
An online search will often lead you to the solution: There’s a package for that! Some dear programmer out in Saskatchewan has simplified the complex task you want to achieve into just a few lines of code. All you have to do is import their package.
A package, which is sometimes also referred to as a library, is a bundle of third-party code written on top of a language or framework. These packages are located in a central repository and have a simple method of importing into your application.
In the Flutter and Dart world, that central repository is called Pub. Need to access the device camera and don’t feel like writing all of the custom code to interface with the underlying operating system? Just open your project’s pubspec.yaml file and add the following line to the dependencies
section:
dependencies:
camera: ^0.10.3
Save that and run flutter pub get
and Flutter downloads thousands of lines of code ready for your project to use. You’ve hardly lifted a finger, and now you can access the device camera on Android, iOS, and the web with just a few lines of code.
So much easier
The advantages of using packages are numerous. They really do make app development so much easier.
Saving you time
Imagine if every developer who wanted to add a camera feature to their app had to write all of that boilerplate code themselves. Being able to use packages like the camera
plugin saves people the time and energy of doing it themselves. No need to reinvent the wheel.