mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-30 00:36:28 +00:00
21 lines
496 B
Dart
21 lines
496 B
Dart
import 'package:package_info/package_info.dart';
|
|
import 'package:version/version.dart';
|
|
|
|
/// Application version helper
|
|
///
|
|
/// @author Pierre Hubert
|
|
|
|
class VersionHelper {
|
|
static PackageInfo _info;
|
|
|
|
static Future<void> ensureLoaded() async {
|
|
_info = await PackageInfo.fromPlatform();
|
|
}
|
|
|
|
/// Get current version information
|
|
static PackageInfo get info => _info;
|
|
|
|
/// Get current application version, in parsed format
|
|
static Version get version => Version.parse(info.version);
|
|
}
|