pub_updater 0.5.0 copy "pub_updater: ^0.5.0" to clipboard
pub_updater: ^0.5.0 copied to clipboard

A Dart package which enables checking whether a package is up to date.

example/main.dart

import 'dart:developer';

import 'package:pub_updater/pub_updater.dart';

Future<void> main() async {
  const packageName = 'my_package';
  const currentVersion = '0.1.0';

  // Initialize an instance of PubUpdater.
  final pubUpdater = PubUpdater();

  // Check whether a package is up to date.
  final isUpToDate = await pubUpdater.isUpToDate(
    packageName: packageName,
    currentVersion: currentVersion,
  );

  if (!isUpToDate) {
    // Upgrade to the latest version if not up to date.
    await pubUpdater.update(packageName: packageName);
  }

  // You can also query the latest version available for a specific package.
  final latestVersion = await pubUpdater.getLatestVersion(packageName);
  log(latestVersion);
}
63
likes
160
points
742k
downloads

Publisher

verified publisherverygood.ventures

Weekly Downloads

A Dart package which enables checking whether a package is up to date.

Repository (GitHub)
View/report issues

Topics

#cli #pub #version

Documentation

API reference

License

MIT (license)

Dependencies

http, json_annotation, process, pub_semver

More

Packages that depend on pub_updater