checkForUpdates method

  1. @override
Future<UpdateInfo> checkForUpdates({
  1. required String packageReference,
  2. required Version currentVersion,
  3. ReleaseChannel? channel,
  4. String? platform,
})
override

Answers "is there a newer version of packageReference than currentVersion, on channel, for platform?".

channel defaults to the package's own defaultChannel, so a client that does not opt in to pre-releases is never offered one. A client already current — or ahead, as a developer running a local build is — gets updateAvailable: false rather than an error.

Implementation

@override
Future<UpdateInfo> checkForUpdates({
  required String packageReference,
  required Version currentVersion,
  ReleaseChannel? channel,
  String? platform,
}) async => UpdateInfo.fromJson(
  await _result(StoreProtocol.updateCheck, {
    'packageReference': packageReference,
    'version': currentVersion.toString(),
    'channel': ?channel?.name,
    'platform': ?platform,
  }),
);