WallPaper_FSX_Flutter/lib/modules/about/about_controller.dart
fengshengxiong 9caadfb09a 1.按照UI图修改
2.完善其他功能
2024-05-17 17:02:22 +08:00

20 lines
479 B
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'package:get/get.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:now_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}';
}
}