comparer 1.0.1 copy "comparer: ^1.0.1" to clipboard
comparer: ^1.0.1 copied to clipboard

outdated

A Dart package that helps to implement value based equality without needing to explicitly override == and hashCode.

comparer #

A Dart package that helps to implement value based equality without needing to explicitly override ==, hashCode and .toString().

Usage #

First, we need to do add comparer to the dependencies of the pubspec.yaml

dependencies:
  comparer: ^1.0.1

Lastly, we need to extend Comparer (or ComparerList, ComparerMap)

import 'package:comparer/comparer.dart';

class Test extends ComparerList {
  Test(this.v1, this.v2, this.v3, this.v4);

  final int v1;
  final String v2;
  final List<Object> v3;
  final Map<String, Object> v4;

  @override
  List<Object> get equals => [v1, v2, v3, v4];
}
1
likes
40
pub points
43%
popularity

Publisher

unverified uploader

A Dart package that helps to implement value based equality without needing to explicitly override == and hashCode.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

collection, meta

More

Packages that depend on comparer