Reputation: 18670
In a Flutter app there is a version
attribute in the pubspec.yaml
file to specify the app version.
Is it possible to access this value from dart code when building for the web ?
Upvotes: 12
Views: 6977
Reputation: 6181
That supports flutter for web and other platforms
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;
Upvotes: 7