Skip to content

Commit a4fc7e5

Browse files
committed
Rename
1 parent 0326298 commit a4fc7e5

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ Available built-in type validators include:
7575
- `FormBuilderValidators.required()` - requires the field to have a non-empty value.
7676
- `FormBuilderValidators.uppercase()` - requires the field's value to be uppercase.
7777
- `FormBuilderValidators.lowercase()` - requires the field's value to be lowercase.
78-
- `FormBuilderValidators.mustBeTrue()` - requires the field's to be true.
79-
- `FormBuilderValidators.mustBeFalse()` - requires the field's to be false.
78+
- `FormBuilderValidators.isTrue()` - requires the field's to be true.
79+
- `FormBuilderValidators.isFalse()` - requires the field's to be false.
8080
- `FormBuilderValidators.hasSpecialChars()` - requires the field's to contain a specified number of special characters.
8181
- `FormBuilderValidators.hasUppercaseChars()` - requires the field's to contain a specified number of uppercase characters.
8282
- `FormBuilderValidators.hasLowercaseChars()` - requires the field's to contain a specified number of lowercase characters.

lib/src/form_builder_validators.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ class FormBuilderValidators {
657657

658658
/// [FormFieldValidator] that requires the field's value to be a bool and true.
659659
/// * [errorText] is the error message to display when the value is not true
660-
static FormFieldValidator<bool> mustBeTrue({
660+
static FormFieldValidator<bool> isTrue({
661661
String? errorText,
662662
}) =>
663663
(valueCandidate) => valueCandidate != true
@@ -666,7 +666,7 @@ class FormBuilderValidators {
666666

667667
/// [FormFieldValidator] that requires the field's value to be a bool and false.
668668
/// * [errorText] is the error message to display when the value is not false
669-
static FormFieldValidator<bool> mustBeFalse({
669+
static FormFieldValidator<bool> isFalse({
670670
String? errorText,
671671
}) =>
672672
(valueCandidate) => valueCandidate != false

test/form_builder_validators_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -677,9 +677,9 @@ void main() {
677677
);
678678

679679
testWidgets(
680-
'FormBuilderValidators.mustBeTrue',
680+
'FormBuilderValidators.isTrue',
681681
(WidgetTester tester) => testValidations(tester, (context) {
682-
final validator = FormBuilderValidators.mustBeTrue();
682+
final validator = FormBuilderValidators.isTrue();
683683
// Pass
684684
expect(validator(true), isNull);
685685
// Fail
@@ -689,9 +689,9 @@ void main() {
689689
);
690690

691691
testWidgets(
692-
'FormBuilderValidators.mustBeFalse',
692+
'FormBuilderValidators.isFalse',
693693
(WidgetTester tester) => testValidations(tester, (context) {
694-
final validator = FormBuilderValidators.mustBeFalse();
694+
final validator = FormBuilderValidators.isFalse();
695695
// Pass
696696
expect(validator(false), isNull);
697697
// Fail

0 commit comments

Comments
 (0)