简体   繁体   中英

How to get current build number in flutter?

The one given by pubspec.yaml seems to be just a initial number. version: 1.0.0+1

There is an internal counter stored somewhere.

How can I check the internal build number?

  • Android:

    build.gradle, versionCode and versionName

  • iOS:

    Info.plist, CFBundleVersion

Or flutter package: https://pub.dev/packages/package_info_plus

  package_info_plus: ^1.0.6

Example:

PackageInfo packageInfo = await PackageInfo.fromPlatform();
String version = packageInfo.version;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM