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
Copy file name to clipboardExpand all lines: lib/src/numeric/max_validator.dart
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,21 @@
1
1
import'../../localization/l10n.dart';
2
2
import'../base_validator.dart';
3
3
4
+
/// {@template max_validator_template}
5
+
/// [MaxValidator] extends [BaseValidator] to validate if a value is less than or equal to a specified maximum value.
6
+
///
7
+
/// This validator checks if the value is a number or a string that can be parsed into a number and ensures it does not exceed the specified maximum value.
8
+
///
9
+
/// ## Parameters:
10
+
///
11
+
/// - [max] The maximum allowable value.
12
+
/// - [inclusive] Whether the maximum value is inclusive. Defaults to true.
13
+
/// - [errorText] The error message returned if the validation fails.
14
+
/// - [checkNullOrEmpty] Whether to check if the value is null or empty.
15
+
///
16
+
/// {@endtemplate}
4
17
classMaxValidator<T> extendsBaseValidator<T> {
18
+
/// Constructor for the maximum value validator.
5
19
constMaxValidator(
6
20
this.max, {
7
21
this.inclusive =true,
@@ -13,8 +27,10 @@ class MaxValidator<T> extends BaseValidator<T> {
0 commit comments