dart_equality 1.0.0 copy "dart_equality: ^1.0.0" to clipboard
dart_equality: ^1.0.0 copied to clipboard

A Dart package that allows values to be compared equality without having to implement the == and hashCode methods.

example/lib/main.dart

import 'package:dart_equality/dart_equality.dart';

class Credentials with DartEquality {
  const Credentials({required this.username, required this.password});

  final String username;
  final String password;

  @override
  List<Object> get props => [username, password];
}

void main() {
  const credentialsA = Credentials(username: 'username', password: 'password');
  const credentialsB = Credentials(username: 'username', password: 'password');

  print(credentialsA == credentialsB); // true
}
1
likes
160
points
36
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Dart package that allows values to be compared equality without having to implement the == and hashCode methods.

Repository (GitHub)
View/report issues

License

Apache-2.0 (license)

Dependencies

flutter, meta

More

Packages that depend on dart_equality