What is a pubspec file in Dart?

pubspec file is a file that stores all the information and dependencies about your Dart and Flutter app. This dependency includes:

Flutter Plugin, Top level library(shared between Android and iOS), Native Dependency (which can be imported to flutter as well as java/kotlin).

Pubspec File is a good way of organizing all your packages in one place. Every plugin / package has a unique name-space which allows you to manage it conveniently without any confusion. In this tutorial, I will show you how you can use the pubspec file in your Flutter App.

In order to create pubspec file, open your terminal inside Dart Editor or Command prompt depending on what editor you are using for flutter development.

 

pubspec.yml
pubspec.yml

 

pubspec.yaml is where you declare the name and version of your app, add dependencies on packages that your app uses, and register services such as a firebase_auth backend, flutter plugin or cloud storage to use when building for production

How do I import images in flutter?

Images can be used in apps by importing them from a package called Image . Flutter supports PNG , JPEG , GIF , WebP , BMP and TIFF formats. To include an image in a widget’s build method

 

pubspec.yml
pubspec.yml

Leave a Comment