getApplicationVersion function Null safety

Future<Map<String, String>> getApplicationVersion()

keys => code, number

Implementation

Future<Map<String, String>> getApplicationVersion() async {
  final packageInfo = await PackageInfo.fromPlatform();
  final code = packageInfo.version;
  final number = packageInfo.buildNumber;
  return {
    'code': code,
    'number': number,
  };
}