You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`FormBuilderValidators.base64()` - requires the field's to be a valid base64 string.
1413
-
-`FormBuilderValidators.colorCode()` - requires the field's value to be a valid color code.
1414
-
-`FormBuilderValidators.duns()` - requires the field's value to be a valid DUNS.
1415
-
-`FormBuilderValidators.isbn()` - requires the field's to be a valid ISBN.
1416
-
-`FormBuilderValidators.json()` - requires the field's to be a valid json string.
1417
-
-`FormBuilderValidators.languageCode()` - requires the field's to be a valid language code.
1418
-
-`FormBuilderValidators.licensePlate()` - requires the field's to be a valid license plate.
1419
-
-`FormBuilderValidators.uuid()` - requires the field's to be a valid uuid.
1420
-
-`FormBuilderValidators.vin()` - requires the field's to be a valid VIN number.
1411
+
-`FormBuilderValidators.base64()`: there is no equivalent to [this validator](https://github.com/flutter-form-builder-ecosystem/form_builder_validators/blob/eafb7662827fe938034be6d2081c9d2844a46c10/lib/src/usecase/base64_validator.dart#L31). Something close would be:
-`FormBuilderValidators.duns()`: there is no equivalent to [this validator](https://github.com/flutter-form-builder-ecosystem/form_builder_validators/blob/eafb7662827fe938034be6d2081c9d2844a46c10/lib/src/usecase/duns_validator.dart#L41). The equivalent would be:
1442
+
```dart
1443
+
// Old API:
1444
+
FormBuilderValidator.duns(
1445
+
errorText: 'error text',
1446
+
);
1447
+
1448
+
// New API:
1449
+
Validators.match(
1450
+
RegExp(r'^\d{9}$'),
1451
+
matchMsg: (_)=>'error text',
1452
+
);
1453
+
```
1454
+
1455
+
-`FormBuilderValidators.isbn()`
1456
+
```dart
1457
+
// Old API:
1458
+
FormBuilderValidator.isbn(
1459
+
errorText: 'error text',
1460
+
);
1461
+
1462
+
// New API:
1463
+
Validators.isbn(
1464
+
isbnMsg: (_)=> 'error text',
1465
+
);
1466
+
```
1467
+
-`FormBuilderValidators.json()`: there is no equivalent to [this validator](https://github.com/flutter-form-builder-ecosystem/form_builder_validators/blob/eafb7662827fe938034be6d2081c9d2844a46c10/lib/src/usecase/json_validator.dart#L31)
-`FormBuilderValidators.languageCode()`: there is no equivalent to [this validator](https://github.com/flutter-form-builder-ecosystem/form_builder_validators/blob/eafb7662827fe938034be6d2081c9d2844a46c10/lib/src/usecase/language_code_validator.dart#L51).
1489
+
```dart
1490
+
// Old API:
1491
+
FormBuilderValidators.languageCode(
1492
+
regex: regex,
1493
+
languageCodeWhitelist: ['val1', 'val2', 'val3'],
1494
+
languageCodeBlacklist: ['val4', 'val5'],
1495
+
errorText: 'invalid language code',
1496
+
);
1497
+
1498
+
// New API (expects input as String):
1499
+
Validators.and([
1500
+
Validators.match(
1501
+
regex,
1502
+
matchMsg: (_)=>'invalid language code'
1503
+
),
1504
+
Validators.inList(
1505
+
['val1', 'val2', 'val3'],
1506
+
inListMsg: (_, __) => 'invalid language code',
1507
+
),
1508
+
Validators.notInList(
1509
+
['val1', 'val2', 'val3'],
1510
+
notInListMsg: (_, __) => 'invalid language code',
1511
+
),
1512
+
]);
1513
+
```
1514
+
1515
+
-`FormBuilderValidators.licensePlate()`: there is no equivalent to [this validator](https://github.com/flutter-form-builder-ecosystem/form_builder_validators/blob/eafb7662827fe938034be6d2081c9d2844a46c10/lib/src/usecase/licenseplate_validator.dart#L52).
1516
+
```dart
1517
+
// Old API:
1518
+
FormBuilderValidators.licensePlate(
1519
+
regex: regex,
1520
+
licensePlateWhitelist: ['val1', 'val2', 'val3'],
1521
+
licensePlateBlacklist: ['val4', 'val5'],
1522
+
errorText: 'invalid license plate',
1523
+
);
1524
+
1525
+
// New API (expects input as String):
1526
+
Validators.and([
1527
+
Validators.match(
1528
+
regex,
1529
+
matchMsg: (_)=>'invalid license plate'
1530
+
),
1531
+
Validators.inList(
1532
+
['val1', 'val2', 'val3'],
1533
+
inListMsg: (_, __) => 'invalid license plate',
1534
+
),
1535
+
Validators.notInList(
1536
+
['val1', 'val2', 'val3'],
1537
+
notInListMsg: (_, __) => 'invalid license plate',
1538
+
),
1539
+
]);
1540
+
```
1541
+
-`FormBuilderValidators.uuid()`: there is no equivalent to [this validator](https://github.com/flutter-form-builder-ecosystem/form_builder_validators/blob/eafb7662827fe938034be6d2081c9d2844a46c10/lib/src/usecase/uuid_validator.dart#L47).
-`FormBuilderValidators.vin()`: there is no equivalent to [this validator](https://github.com/flutter-form-builder-ecosystem/form_builder_validators/blob/eafb7662827fe938034be6d2081c9d2844a46c10/lib/src/usecase/vin_validator.dart#L52).
0 commit comments