Skip to content

Commit

Permalink
Merge pull request #7 from ebabhi/main
Browse files Browse the repository at this point in the history
equality check for  Validator
  • Loading branch information
kishormainali authored May 8, 2024
2 parents dcd3be5 + 6f3bd5a commit f275915
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 3.1.7
- Equality added for validator

# 3.1.6

- Re-land logger
Expand Down
5 changes: 4 additions & 1 deletion lib/src/form/validators.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ part of 'form.dart';
/// A [Validator] is base class for handling form validation.
///
/// {@endtemplate}
abstract class Validator<T> {
abstract class Validator<T> extends Equatable {
/// {@macro validator}
const Validator(this.message);
final String? message;
Expand All @@ -15,6 +15,9 @@ abstract class Validator<T> {
String? call(T value) {
return isValid(value) ? null : message;
}

@override
List<Object?> get props => [message];
}

/// {@template emailValidator}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: fp_util
description: Utilities and Extensions for num,BuildContext,EdgeInsets,File,String. constants for horizontal and vertical spacing.
version: 3.1.6
version: 3.1.7
homepage: https://docs.kishormainali.com/
repository: https://github.com/kishormainali/fp_util
issue_tracker: https://github.com/kishormainali/fp_util/issues
Expand Down

0 comments on commit f275915

Please sign in to comment.