getAppInfo method
getAppInfo is used to retrieve the information like appVersion
,
packageName
, buildNumber
and much more from the current build of the app.
Implementation
Future<AppModel> getAppInfo() async {
final PackageInfo _packageInfo = await PackageInfo.fromPlatform();
return AppModel(
appName: _packageInfo.appName,
appVersion: _packageInfo.version,
packageName: _packageInfo.packageName,
appBuildNumber: _packageInfo.buildNumber,
);
}