Reputation: 3262
Assuming we have pubspec.yaml like:
name: myApp
version: x.y.z
Can I get above x.y.z version in main function in runtime ?
Upvotes: 3
Views: 356
Reputation: 657456
Currently there is no universal way. See https://github.com/google/grinder.dart/blob/19a6d13866de8f4a3b295074a3487eaa77b7a2f8/lib/src/cli.dart#L17 for how it's done in the Grinder package. There sre plans to improve this. See for example this discussion https://groups.google.com/a/dartlang.org/forum/m/#!topic/core-dev/8WrVpjD6tt8
Upvotes: 2