hash_compare 0.1.0+4

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:

  hash_compare: any
  build_runner: any
  build_verify: any

And add this to build.yaml:

        - 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:

  hash_compare: ^0.1.0+4

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub 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';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Apr 4, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6

Health suggestions

Fix lib/builder.dart. (-1.49 points)

Analysis of lib/builder.dart reported 3 hints:

line 33 col 33: 'name' is deprecated and shouldn't be used. Check element, or use getDisplayString().

line 74 col 10: Unnecessary new keyword.

line 74 col 33: Unnecessary new keyword.

Fix lib/hash_compare.dart. (-0.50 points)

Analysis of lib/hash_compare.dart reported 1 hint:

line 12 col 21: Avoid const keyword.

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.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
analyzer ^0.39.4 0.39.5
build ^1.2.2 1.2.2
build_config ^0.4.1+1 0.4.2
source_gen ^0.9.4+7 0.9.5
Transitive dependencies
_fe_analyzer_shared 2.0.0
args 1.6.0
async 2.4.1
charcode 1.1.3
checked_yaml 1.0.2
collection 1.14.12
convert 2.1.1
crypto 2.1.4
csslib 0.16.1
dart_style 1.3.3
glob 1.2.0
html 0.14.0+3
js 0.6.1+1
json_annotation 3.0.1
logging 0.11.4
meta 1.1.8
node_interop 1.0.3
node_io 1.0.1+2
package_config 1.9.3
path 1.6.4
pedantic 1.9.0
pub_semver 1.4.4
pubspec_parse 0.1.5
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
watcher 0.9.7+14
yaml 2.2.0
Dev dependencies
build_runner any
english_words ^3.1.5
test any