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 11{
2- "@@last_modified": "2020-10-08T17:47:59.750726 ",
2+ "@@last_modified": "2020-11-13T10:38:27.938366 ",
33 "requiredErrorText": "This field cannot be empty.",
44 "@requiredErrorText": {
55 "description": "Error Text for required validator",
7070 "type": "text",
7171 "placeholders": {}
7272 },
73+ "integerErrorText": "Value must be an integer.",
74+ "@integerErrorText": {
75+ "description": "Error Text for integer validator",
76+ "type": "text",
77+ "placeholders": {}
78+ },
7379 "creditCardErrorText": "This field requires a valid credit card number.",
7480 "@creditCardErrorText": {
7581 "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';
1616import 'package:intl/src/intl_helpers.dart' ;
1717
1818import 'messages_en.dart' as messages_en;
19+ import 'messages_es.dart' as messages_es;
1920import 'messages_messages.dart' as messages_messages;
2021
2122typedef Future <dynamic > LibraryLoader ();
2223Map <String , LibraryLoader > _deferredLibraries = {
2324 'en' : () => new Future .value (null ),
25+ 'es' : () => new Future .value (null ),
2426 'messages' : () => new Future .value (null ),
2527};
2628
2729MessageLookupByLibrary _findExact (String localeName) {
2830 switch (localeName) {
2931 case 'en' :
3032 return messages_en.messages;
33+ case 'es' :
34+ return messages_es.messages;
3135 case 'messages' :
3236 return messages_messages.messages;
3337 default :
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ class MessageLookup extends MessageLookupByLibrary {
4040 "emailErrorText" : MessageLookupByLibrary .simpleMessage (
4141 "This field requires a valid email address." ),
4242 "equalErrorText" : m4,
43+ "integerErrorText" :
44+ MessageLookupByLibrary .simpleMessage ("Value must be an integer." ),
4345 "ipErrorText" : MessageLookupByLibrary .simpleMessage (
4446 "This field requires a valid IP." ),
4547 "matchErrorText" : MessageLookupByLibrary .simpleMessage (
Original file line number Diff line number Diff line change @@ -97,6 +97,12 @@ class FormBuilderLocalizations {
9797 desc: 'Error Text for numeric validator' ,
9898 );
9999
100+ String get integerErrorText => Intl .message (
101+ 'Value must be an integer.' ,
102+ name: 'integerErrorText' ,
103+ desc: 'Error Text for integer validator' ,
104+ );
105+
100106 String get creditCardErrorText => Intl .message (
101107 'This field requires a valid credit card number.' ,
102108 name: 'creditCardErrorText' ,
Original file line number Diff line number Diff line change @@ -192,7 +192,7 @@ class FormBuilderValidators {
192192 }) =>
193193 (valueCandidate) => true == valueCandidate? .isNotEmpty &&
194194 null == int .tryParse (valueCandidate, radix: radix)
195- ? errorText ?? FormBuilderLocalizations .of (context).numericErrorText
195+ ? errorText ?? FormBuilderLocalizations .of (context).integerErrorText
196196 : null ;
197197
198198 /// [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