dart_equality 1.0.0
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.
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
}