File tree Expand file tree Collapse file tree 5 files changed +20
-2
lines changed Expand file tree Collapse file tree 5 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
- "@@last_modified": "2020-10-08T17:47:59.750726 ",
2
+ "@@last_modified": "2020-11-13T10:38:27.938366 ",
3
3
"requiredErrorText": "This field cannot be empty.",
4
4
"@requiredErrorText": {
5
5
"description": "Error Text for required validator",
70
70
"type": "text",
71
71
"placeholders": {}
72
72
},
73
+ "integerErrorText": "Value must be an integer.",
74
+ "@integerErrorText": {
75
+ "description": "Error Text for integer validator",
76
+ "type": "text",
77
+ "placeholders": {}
78
+ },
73
79
"creditCardErrorText": "This field requires a valid credit card number.",
74
80
"@creditCardErrorText": {
75
81
"description": "Error Text for credit card validator",
Original file line number Diff line number Diff line change @@ -16,18 +16,22 @@ import 'package:intl/message_lookup_by_library.dart';
16
16
import 'package:intl/src/intl_helpers.dart' ;
17
17
18
18
import 'messages_en.dart' as messages_en;
19
+ import 'messages_es.dart' as messages_es;
19
20
import 'messages_messages.dart' as messages_messages;
20
21
21
22
typedef Future <dynamic > LibraryLoader ();
22
23
Map <String , LibraryLoader > _deferredLibraries = {
23
24
'en' : () => new Future .value (null ),
25
+ 'es' : () => new Future .value (null ),
24
26
'messages' : () => new Future .value (null ),
25
27
};
26
28
27
29
MessageLookupByLibrary _findExact (String localeName) {
28
30
switch (localeName) {
29
31
case 'en' :
30
32
return messages_en.messages;
33
+ case 'es' :
34
+ return messages_es.messages;
31
35
case 'messages' :
32
36
return messages_messages.messages;
33
37
default :
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ class MessageLookup extends MessageLookupByLibrary {
40
40
"emailErrorText" : MessageLookupByLibrary .simpleMessage (
41
41
"This field requires a valid email address." ),
42
42
"equalErrorText" : m4,
43
+ "integerErrorText" :
44
+ MessageLookupByLibrary .simpleMessage ("Value must be an integer." ),
43
45
"ipErrorText" : MessageLookupByLibrary .simpleMessage (
44
46
"This field requires a valid IP." ),
45
47
"matchErrorText" : MessageLookupByLibrary .simpleMessage (
Original file line number Diff line number Diff line change @@ -97,6 +97,12 @@ class FormBuilderLocalizations {
97
97
desc: 'Error Text for numeric validator' ,
98
98
);
99
99
100
+ String get integerErrorText => Intl .message (
101
+ 'Value must be an integer.' ,
102
+ name: 'integerErrorText' ,
103
+ desc: 'Error Text for integer validator' ,
104
+ );
105
+
100
106
String get creditCardErrorText => Intl .message (
101
107
'This field requires a valid credit card number.' ,
102
108
name: 'creditCardErrorText' ,
Original file line number Diff line number Diff line change @@ -192,7 +192,7 @@ class FormBuilderValidators {
192
192
}) =>
193
193
(valueCandidate) => true == valueCandidate? .isNotEmpty &&
194
194
null == int .tryParse (valueCandidate, radix: radix)
195
- ? errorText ?? FormBuilderLocalizations .of (context).numericErrorText
195
+ ? errorText ?? FormBuilderLocalizations .of (context).integerErrorText
196
196
: null ;
197
197
198
198
/// [FormFieldValidator] that requires the field's value to be a valid credit card number.
You can’t perform that action at this time.
0 commit comments