Start a Project

Pubspec.yaml in Flutter

pubspec.yaml in Flutter, it is basically referred to as pubspec.

This file is created when we create a new Flutter project and it is located in the root folder of the project.

It is written in YAML (Yet Another Markup Language) but it is completely human readable.

Looking for the best App Development Services, check out Flutter development services offered by Mobikul.

When we talk about pubspec.yaml file the first thing that comes to our mind is that pubspec.yaml file is used in order to add the dependencies and assets…

But in real there are many other important features that are supported in pubspec.yaml

So, let’s begin reading and learning about those properties of pubspec.yaml file……….

  1. name – Name is used to specify the unique name for our package. It should always be unique and should follow the basic standards like the name should be in lowercase with an underscore.
  2. version – Every package has its own version. It is required in order to maintain the publishing cycle. It can be omitted if the package is not to be published. It looks like 1.0.0
  3. description – This is a plain text that is required when we need to publish the package on pub.dev as it helps the users to understand the use of the package. It takes 60-180 characters as a short description.
  4. homepage – It contains a URL reference to the website of our package.
  5. repository – In this section, we can specify the URL of our repository, so that other users can have a view of the code as well.
  6. dependencies – In this section, we list all the dependencies that will be used in our project.
  7. platforms – When we publish a package we need to specify that our package is supported by which platforms. Eg. –

Conclusion

In this blog, we have discussed in detail about the pubspec.yaml file within our Flutter project.

Read more interesting Flutter Blogs by Mobikul.

Thanks for reading!!

References

https://docs.fleaflet.dev/

Exit mobile version