5

I need the flutter version and package versions for logging purposes.Is there any way to get this from flutter code or using flutter api's rather than makefile.

2
  • Does this answer your question? How to get Dart and Flutter version within the app Commented Sep 26, 2022 at 14:30
  • 1
    No @ibhavikmakwana the answer suggests to run a script but script needs to be run separately.I am looking for a solution to get these info at runtime. Commented Sep 28, 2022 at 11:01

1 Answer 1

3

Use package_info_plus package.

WidgetsFlutterBinding.ensureInitialized();


PackageInfo packageInfo = await PackageInfo.fromPlatform();

String appName = packageInfo.appName;
String packageName = packageInfo.packageName;
String version = packageInfo.version;
String buildNumber = packageInfo.buildNumber;
Sign up to request clarification or add additional context in comments.

1 Comment

thx! but this gives the app version not the flutter version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.