init static method

Future<PackageInfo> init()

初始化应用信息

Implementation

static Future<PackageInfo> init() async {
  try {
    packageInfo = await PackageInfo.fromPlatform();
  } catch (e) {
    packageInfo = PackageInfo(
        appName: '', packageName: '', version: '', buildNumber: '');
  }
  return packageInfo;
}