Flutter: Display Change Log / Release Notes / "What's new" after upgrade to new app version

1.6k Views Asked by At

I'm currently searching for a while how I can implement the following feature with Flutter for Android and IOS apps: When the application is opened the first time after a version update I'd like to show a dialog with the information what's new in the new version / what has been fixed etc. - some kind of release notes.

I know various ways to show this dialog on application start; but how can I ensure that this is done only one time after the app version changed? I was thinking about storing the various version messages as texts on the remote backend and give them an unique ID; via shared preferences or other persistance the last shown message ID could be stored and compared to the last available one. But I see this feature in so many apps that I suppose there's a "standard way" to do this or maybe a package which supports this.

Kind regards Michael

2

There are 2 best solutions below

1
On

by package_info package, you can figure out the current version of the application. if the user updates the application by release centers(like google play), information stored in sharedPreference, remains. so you can save the application's version in sharedPreference and every time the app opens check the current version with info saved in sharedPreference if is the same no need for showing release note but if the current version is higher than the stored version, show release note and update sharePreference with the new version.

PackageInfo packageInfo = await PackageInfo.fromPlatform();
String currentVersion=packageInfo.version.toString();
SharedPreferences pref= await SharedPreferences.getInstance();
String latestAppVersion= pref.getString("latestAppVersion");
if(currentVersion.toInt()>latestAppVersion.toInt()){
 //show release note
 //update sharedPreferences with currentVersion

}
1
On

I don't know if there is a standard way of doing it, but here is a simple way to do it.

Include "package_info" plugin in your project.

import 'package:package_info/package_info.dart';

PackageInfo.fromPlatform().then((PackageInfo packageInfo) {
String runningVersion = packageInfo.version;
//compare runningVersion to the one saved in sharedPrefs
//if they don't match show the message
//then save runningVersion to sharedPrefs
});