Skip to content

Instantly share code, notes, and snippets.

@AseemWangoo
Created September 6, 2022 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AseemWangoo/ce509983caba9f3abf38a540dc3c82e2 to your computer and use it in GitHub Desktop.
Save AseemWangoo/ce509983caba9f3abf38a540dc3c82e2 to your computer and use it in GitHub Desktop.
package_info
abstract class PackageInfoService {
Future<String> appVersion();
}
class PackageInfoServiceImpl implements PackageInfoService {
@override
Future<String> appVersion() async {
final packageInfo = await PackageInfo.fromPlatform();
String version = packageInfo.version;
String build = packageInfo.buildNumber;
return 'v$version ($build)';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment