Created
December 8, 2020 19:33
-
-
Save samuelematias/3aa70b51742cea7d3dd879a021b9d01a to your computer and use it in GitHub Desktop.
Get some informations about you Flutter app.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:package_info/package_info.dart'; //https://pub.dev/packages/package_info | |
class AppInfo { | |
Future<String> get version async { | |
final PackageInfo packageInfo = await PackageInfo.fromPlatform(); | |
return packageInfo.version ?? 'Unknown Version'; // 1.2.7 | |
} | |
Future<String> get buildNumber async { | |
final PackageInfo packageInfo = await PackageInfo.fromPlatform(); | |
return packageInfo.buildNumber ?? 'Unknown Build Version'; // 1500 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment