Migrate
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
|
||||
class HomeViewController extends GetxController {
|
||||
Rx<PackageInfo> packageInfo = PackageInfo(
|
||||
appName: 'Unknown',
|
||||
packageName: 'Unknown',
|
||||
version: 'Unknown',
|
||||
buildNumber: 'Unknown',
|
||||
buildSignature: 'Unknown',
|
||||
installerStore: 'Unknown',
|
||||
).obs;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
_initPackageInfo();
|
||||
super.onInit();
|
||||
//Loading, Success, Error handle with 1 line of code
|
||||
}
|
||||
|
||||
Future<void> _initPackageInfo() async {
|
||||
final info = await PackageInfo.fromPlatform();
|
||||
packageInfo.value = info;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user