First of All there is package
to find your app current version
number
and build number
, I have used this personally with the backend to show some new
features to our new users.
Add this to your package's pubspec.yaml file:
package_info: ^0.4.0+16
Now import
the statement into your dart file
import 'package:package_info/package_info.dart';
And use this if your method
is marked as async
:
PackageInfo packageInfo = await PackageInfo.fromPlatform();
String appName = packageInfo.appName;
String packageName = packageInfo.packageName;
String version = packageInfo.version;
String buildNumber = packageInfo.buildNumber;
Now, What you have to do is that send the current version number in your API,
And have a Current Version Value stored in backend, To check for the Versions you are sending in the API's and Compare them to show new Features,
Like Say If I am old User, So My APP Version number is 1 and API's is sending 1 in the backend too.
But If I am new User then, My APP version is number greater than 1 and API's is sending version number greater than 1, And I can see the update in the app if My Version number is greater than 1 as a new User.
Click Here For More Reference to use the Package
Sorry For bad English