check_for_update 1.0.1

  • Installing
  • Versions
  • 46


version 1.0.1

Generates Dart code to automatically check for a new version of the current package. Your project should depend on http. The output code is platform-independent.

One final field is generated: PACKAGE_VERSION - The package's active version. Two methods are generated:

  • fetchCurrentVersion: Asks the Pub API what the latest version of the package is.
  • checkForUpdate: Compares PACKAGE_VERSION to the result of fetchCurrentVersion and returns null if no update is available. Otherwise, the new version will be returned.


Generate from the project pubspec.yaml:

import 'package:build_runner/build_runner.dart';
import 'package:check_for_update/builder.dart';

final PhaseGroup phaseGroup = new PhaseGroup.singleAction(
    new CheckForUpdateBuilder(),
    new InputSet('example', const ['pubspec.yaml']));

You can add the output to a subdirectory, i.e. lib:

new CheckForUpdateBuilder(subDirectory: 'lib')


Specifying a specific package name to scan for updates:

new CheckForUpdateBuilder(packageName: 'shelf')

Specifying a custom Pub API URL:

new CheckForUpdateBuilder(pubApiRoot: '')

Specifying a specific version to check against:

new CheckForUpdateBuilder(currentVersion: new Version(1, 2, 0, pre: 'alpha.6'))

1. Depend on it

Add this to your package's pubspec.yaml file:

  check_for_update: "^1.0.1"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:check_for_update/check_for_update.dart';
Version Uploaded Documentation Archive
1.0.1 Mar 24, 2017 Go to the documentation of check_for_update 1.0.1 Download check_for_update 1.0.1 archive
1.0.0 Mar 24, 2017 Go to the documentation of check_for_update 1.0.0 Download check_for_update 1.0.0 archive


This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1


Describes how popular the package is relative to other packages. [more]
0 / 100
Code health derived from static analysis. [more]
100 / 100
Reflects how tidy and up-to-date the package is. [more]
80 / 100
Overall score:
Weighted score of the above. [more]


Detected platforms: other

Primary library: package:check_for_update/check_for_update.dart with components: io, mirrors.


  • Maintain

    Changelog entries help clients to follow the progress in your code.

  • Maintain an example.

    None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use check_for_update.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0
build ^0.7.0 0.7.3 0.12.0+1
code_builder ^1.0.0-beta 1.0.4 3.0.1
pub_semver ^1.3.0 1.3.2
pubspec ^0.0.14 0.0.15
Transitive dependencies
analyzer 0.29.11 0.31.0+1
args 0.13.7 1.3.0
async 2.0.3
charcode 1.1.1
cli_util 0.0.1+2 0.1.2+1
collection 1.14.5
concepts 0.2.0
convert 2.0.1
crypto 2.0.2+1
csslib 0.14.1
dart_style 1.0.4 1.0.9+1
either 0.1.8
func 1.0.0
glob 1.1.5
html 0.13.2+2
isolate 1.1.0
logging 0.11.3+1
matcher 0.12.1+4
meta 1.1.2
option 1.2.0
package_config 1.0.3
path 1.3.9 1.5.1
plugin 0.2.0+2
quiver 0.21.4 0.28.0
quiver_iterables 1.0.1
source_span 1.4.0
stack_trace 1.9.1
string_scanner 1.0.2
stuff 0.0.7
typed_data 1.1.5
uri 0.11.1
utf 0.9.0+4
watcher 0.9.7+7
when 0.2.0
which 0.1.3
yaml 2.1.13
yamlicious 0.0.5