app-starlock/lib/tools/platform_info_services.dart
2024-05-18 09:37:50 +08:00

14 lines
448 B
Dart
Executable File

import 'package:get/get.dart';
import 'package:package_info_plus/package_info_plus.dart';
class PlatformInfoService extends GetxService {
static PlatformInfoService get to => Get.find<PlatformInfoService>();
late PackageInfo _packageInfo;
PackageInfo get info => _packageInfo;
Future<PlatformInfoService> init() async {
PackageInfo packageInfo = await PackageInfo.fromPlatform();
_packageInfo = packageInfo;
return this;
}
}