hash_compare 0.1.0+3

  • README.md
  • Installing
  • Versions
  • new48

Hash and compare function generator #

This Dart source generator automatically generates hash and compare functions that you can use in your classes. The generated functions internally use quiver for hashing and can automatically deal with lists, sets and maps. The naming convention for the generated functions is _hashMyClass and _compareMyClass. Annotate classes with @hashCompare to generate these functions.

Usage #

To use this generator, add the following to your pubspec.yaml:

dev_dependencies:
  hash_compare: any
  build_runner: any
  build_verify: any

And add this to build.yaml:

targets:
  $default:
    builders:
      hash_compare:
        generate_for:
        - lib/**.dart

To build use pub run build_runner build or similar commands. To make sure the build is updated when testing, add an expectBuildClean assertion to your test code. When publishing to Pub you need to include generated files.

Use this package as a library

1. Depend on it

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


dependencies:
  hash_compare: ^0.1.0+3

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:hash_compare/hash_compare.dart';
  
Version Uploaded Documentation Archive
0.1.0+3 Feb 12, 2019 Go to the documentation of hash_compare 0.1.0+3 Download hash_compare 0.1.0+3 archive
0.1.0+2 Feb 12, 2019 Go to the documentation of hash_compare 0.1.0+2 Download hash_compare 0.1.0+2 archive
0.1.0+1 Feb 11, 2019 Go to the documentation of hash_compare 0.1.0+1 Download hash_compare 0.1.0+1 archive
0.1.0 Jan 31, 2019 Go to the documentation of hash_compare 0.1.0 Download hash_compare 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
16
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
50
Overall:
Weighted score of the above. [more]
48
Learn more about scoring.

We analyzed this package on Feb 14, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.13

Platforms

Detected platforms: Flutter, web, other

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

Maintenance issues and suggestions

Provide a file named CHANGELOG.md. (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by stagehand.

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and hash_compare.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
analyzer ^0.32.2 0.32.6 0.35.1
build ^1.1.0 1.1.0 1.1.1
build_config ^0.3.1+4 0.3.1+4
source_gen ^0.9.0 0.9.1+3 0.9.4+1
Transitive dependencies
args 1.5.1
async 2.0.8
charcode 1.1.2
collection 1.14.11
convert 2.1.1
crypto 2.0.6
csslib 0.14.6
dart_style 1.1.3 1.2.3
front_end 0.1.4+2 0.1.11
glob 1.1.7
html 0.13.3+3
json_annotation 2.0.0
kernel 0.3.4+2 0.3.11
logging 0.11.3+2
meta 1.1.7
package_config 1.0.5
path 1.6.2
plugin 0.2.0+3
pub_semver 1.4.2
pubspec_parse 0.1.4
source_span 1.5.4
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6
utf 0.9.0+5
watcher 0.9.7+10
yaml 2.1.15
Dev dependencies
build_runner any
english_words ^3.1.5
test any