Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Read pubspec.yaml from dart code in Flutter?

Tags:

flutter

dart

I want to get access to the pubspec.yaml and read its properties from dart code in my Flutter application, while the application is running. How can I do so?

PS: I want to read the name, description and version properties from the pubspec during the application runtime!

like image 452
Gurleen Sethi Avatar asked Jan 30 '26 02:01

Gurleen Sethi


1 Answers

Just as mentioned in the comments above, the package_info_plus can help you achieve that. It helps you access the properties of pubspec.yaml during runtime.

  • https://pub.dev/packages/package_info_plus
  • Duplicate of Access to pubspec.yaml attributes (version) from Dart app
like image 190
Aster Joules Avatar answered Jan 31 '26 17:01

Aster Joules



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!