20 lines
481 B
Dart
20 lines
481 B
Dart
import 'package:get/get.dart';
|
||
import 'package:package_info_plus/package_info_plus.dart';
|
||
import 'package:hello_wallpaper/res/values/strings.dart';
|
||
|
||
class AboutController extends GetxController {
|
||
var versionName = ''.obs;
|
||
|
||
@override
|
||
void onReady() {
|
||
super.onReady();
|
||
_getVersion();
|
||
}
|
||
|
||
/// 获取版本号
|
||
void _getVersion() async {
|
||
final packageInfo = await PackageInfo.fromPlatform();
|
||
versionName.value = 'App Version:${packageInfo.version}';
|
||
}
|
||
}
|