updateLastVersion method

Future<bool> updateLastVersion([
  1. String? version
])

Sets the last know version and persists it. If called without parameter the currently running version is set.

Implementation

Future<bool> updateLastVersion([String? version]) async {
  if (customVersionUpdate != null) {
    return customVersionUpdate!(version);
  }
  version ??= await getCurrentVersion();
  final prefs = await SharedPreferences.getInstance();
  return prefs.setString(keyLastVersion, version);
}