initialize static method
Initialize the version from pubspec.yaml
Implementation
static Future<void> initialize() async {
try {
final pubspecFile = File('pubspec.yaml');
if (await pubspecFile.exists()) {
final content = await pubspecFile.readAsString();
final yaml = loadYaml(content);
_version = yaml['version']?.toString();
}
} catch (e) {
// If we can't read the version, keep the default
_version = null;
}
}