AppUpdateInfo.fromJson constructor

AppUpdateInfo.fromJson(
  1. Map? json
)

An instance of the AppUpdateInfo from json

Implementation

AppUpdateInfo.fromJson(Map<dynamic, dynamic>? json) {
  json ??= {};
  _packageName = json['packageName'];
  try {
    //a value from UpdateAvailability
    _updateAvailability =
        UpdateAvailability.values[json['updateAvailability'] ?? 0];
  } catch (e) {
    _updateAvailability = UpdateAvailability.unknown;
  }
  _immediateAllowed = json['immediateAllowed'];
  _flexibleAllowed = json['flexibleAllowed'];
  _clientVersionStalenessDays = json['clientVersionStalenessDays'];
  _updatePriority = json['updatePriority'];
  _availableVersionCode = json['availableVersionCode'];
  _installStatus = json['installStatus'];
}