@@ -217,6 +217,18 @@ void main() {
217
217
expect (validator ('' ), isNull);
218
218
expect (validator ('the quick brown' ), isNull);
219
219
expect (validator ('The quick brown fox jumps' ), isNull);
220
+ // 1 White spaces to test the trimming of the string
221
+ expect (validator (' ' ), isNull);
222
+ // 5 White spaces to test the trimming of the string
223
+ expect (validator (' ' ), isNull);
224
+ // + 1 White space to test the trimming of the string
225
+ expect (validator (' The quick brown fox' ), isNull);
226
+ // + 1 White space to test the trimming of the string
227
+ expect (validator ('The quick brown fox ' ), isNull);
228
+ // + 1 White space to test the trimming of the string
229
+ expect (validator (' The quick brown fox jumps' ), isNull);
230
+ // + 1 White space to test the trimming of the string
231
+ expect (validator ('The quick brown fox jumps ' ), isNull);
220
232
// Fail
221
233
expect (validator ('The quick brown fox jumps over' ), isNotNull);
222
234
expect (validator ('The quick brown fox jumps over the lazy dog' ),
@@ -236,6 +248,14 @@ void main() {
236
248
expect (validator (null ), isNotNull);
237
249
expect (validator ('' ), isNotNull);
238
250
expect (validator ('The quick brown' ), isNotNull);
251
+ // 1 White spaces to test the trimming of the string
252
+ expect (validator (' ' ), isNotNull);
253
+ // 5 White spaces to test the trimming of the string
254
+ expect (validator (' ' ), isNotNull);
255
+ // + 1 White space to test the trimming of the string
256
+ expect (validator (' The quick brown fox' ), isNotNull);
257
+ // + 1 White space to test the trimming of the string
258
+ expect (validator ('The quick brown fox ' ), isNotNull);
239
259
// Advanced
240
260
final validatorAllowEmpty =
241
261
FormBuilderValidators .minWordsCount (5 , allowEmpty: true );
0 commit comments