check_for_update 1.0.1

  • README.md
  • Installing
  • Versions
  • 43

check_for_update

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.

Usage

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')

Overrides

Specifying a specific package name to scan for updates:

new CheckForUpdateBuilder(packageName: 'shelf')

Specifying a custom Pub API URL:

new CheckForUpdateBuilder(pubApiRoot: 'https://foo.bar/pub-api')

Specifying a specific version to check against:

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

Use this package as a library

1. Depend on it

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


dependencies:
  check_for_update: "^1.0.1"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages 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

Analysis

We analyzed this package on Jun 12, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.60.0
  • pana: 0.11.3

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
63 / 100
Overall score:
Weighted score of the above. [more]
43
Learn more about scoring.

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:check_for_update/check_for_update.dart.

Suggestions

  • Maintain CHANGELOG.md.

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

  • Package is getting outdated.

    The package was released 63 weeks ago.

  • 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.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0
build ^0.7.0 0.7.3 0.12.6
code_builder ^1.0.0-beta 1.0.4 3.1.0
pub_semver ^1.3.0 1.4.1
pubspec ^0.0.14 0.0.15
Transitive dependencies
analyzer 0.29.11 0.32.1
args 0.13.7 1.4.3
async 2.0.7
charcode 1.1.1
cli_util 0.0.1+2 0.1.3
collection 1.14.10
concepts 0.2.0
convert 2.0.1
crypto 2.0.3
csslib 0.14.4
dart_style 1.0.4 1.0.14
either 0.1.8
func 1.0.0
glob 1.1.5
html 0.13.3+1
isolate 1.1.0 2.0.1
logging 0.11.3+1
matcher 0.12.2+1
meta 1.1.5
option 1.2.0
package_config 1.0.3
path 1.3.9 1.6.0
plugin 0.2.0+2
quiver 0.21.4 0.29.0+1
quiver_iterables 1.0.1
source_span 1.4.0
stack_trace 1.9.2
string_scanner 1.0.2
stuff 0.0.7
typed_data 1.1.5
uri 0.11.2
utf 0.9.0+4
watcher 0.9.7+8
when 0.2.0
which 0.1.3
yaml 2.1.14
yamlicious 0.0.5