WallPaper_FSX_Flutter/lib/modules/about/about_controller.dart
2024-05-24 18:50:51 +08:00

19 lines
423 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';
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}';
}
}