package_info_plus 1.3.0 package_info_plus: ^1.3.0 copied to clipboard
Flutter plugin for querying information about the application package, such as CFBundleVersion on iOS or versionCode on Android.
This Flutter plugin provides an API for querying information about an application package.
Platform Support #
You can use the PackageInfo to query information about the application package. This works both on iOS and Android.
import 'package:package_info_plus/package_info_plus.dart'; PackageInfo packageInfo = await PackageInfo.fromPlatform(); String appName = packageInfo.appName; String packageName = packageInfo.packageName; String version = packageInfo.version; String buildNumber = packageInfo.buildNumber;
Known Issues #
As noted on issue 20761, package_info on iOS
requires the Xcode build folder to be rebuilt after changes to the version string in
Clean the Xcode build folder with:
XCode Menu -> Product -> (Holding Option Key) Clean build folder.
Check out our documentation website to learn more. Plus plugins documentation
Android (and potentially all platforms) #
PackageInfo.fromPlatform() before the
runApp() call will cause an exception.
Important: As of January 2021, the Flutter team is no longer accepting non-critical PRs for the original set of plugins in
flutter/plugins, and instead they should be submitted in this project. You can read more about this announcement here. as well as in the Flutter 2 announcement blog post.