Skip to content

Commit da2debe

Browse files
committed
Add surface
1 parent f9b85c0 commit da2debe

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

lib/src/form_builder_validators.dart

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,6 +1182,36 @@ class FormBuilderValidators {
11821182
checkNullOrEmpty: checkNullOrEmpty,
11831183
).validate;
11841184

1185+
/// [FormFieldValidator] that requires the field's value to be a valid float.
1186+
///
1187+
/// ## Parameters:
1188+
/// - [errorText] The error message when the float is invalid.
1189+
/// - [checkNullOrEmpty] Whether to check for null or empty values.
1190+
/// {@macro float_template}
1191+
static FormFieldValidator<T> float<T>({
1192+
String? errorText,
1193+
bool checkNullOrEmpty = true,
1194+
}) =>
1195+
FloatValidator<T>(
1196+
errorText: errorText,
1197+
checkNullOrEmpty: checkNullOrEmpty,
1198+
).validate;
1199+
1200+
/// [FormFieldValidator] that requires the field's value to be a valid hexadecimal.
1201+
///
1202+
/// ## Parameters:
1203+
/// - [errorText] The error message when the hexadecimal is invalid.
1204+
/// - [checkNullOrEmpty] Whether to check for null or empty values.
1205+
/// {@macro hexadecimal_template}
1206+
static FormFieldValidator<String> hexadecimal({
1207+
String? errorText,
1208+
bool checkNullOrEmpty = true,
1209+
}) =>
1210+
HexadecimalValidator(
1211+
errorText: errorText,
1212+
checkNullOrEmpty: checkNullOrEmpty,
1213+
).validate;
1214+
11851215
/// [FormFieldValidator] that requires the value to be a valid integer.
11861216
///
11871217
/// ## Parameters:

0 commit comments

Comments
 (0)