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