Flutter get app install date
 
How to find current application install time or date on Flutter.

For this we are using device_apps library. https://pub.dev/packages/device_apps

We are using 3 library.
- intl lib from DateFormat
- package_info from PackageInfo.packageName
- device_apps from installTimeMillis
	
	
Future<String> getAppInstallDate(String dateFormat) async {

  /**package_info: https://pub.dev/packages/package_info**/
  PackageInfo packageInfo = await PackageInfo.fromPlatform();

  /** device_apps: https://pub.dev/packages/device_apps **/
  Application app = await DeviceApps.getApp(packageInfo.packageName);

  var date = new DateTime.fromMicrosecondsSinceEpoch(app.installTimeMillis);

  /** intl: https://pub.dev/packages/intl **/
  var dFormat = DateFormat(dateFormat);

  return dFormat.format(date);
  
}
		
 

Author: Engin ATALAY
Date: 10.01.2021 19:37:37
View Count: 1693
 
 

COMMENTS
 
No comments yet. Be the first to comment who you are.
 
 
 
 
 
 
 
WRITE COMMENT
 
 
Your Name :
 
 
 
E-mail :
 
 
 
Your Message :
 
 
 
 
 
 
 
This project : ASP.NET MVC , RAZOR, Entity Framework , CSS , HTML , JQUERY(2.0.2) , AJAX the C# side-tier architecture was developed with logic.
 
Yukarı Çık