Created
September 6, 2022 14:14
-
-
Save AseemWangoo/ce509983caba9f3abf38a540dc3c82e2 to your computer and use it in GitHub Desktop.
package_info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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