@@ -119,28 +119,28 @@ The default error message is in English. To allow for localization of default er
119119
120120``` Dart
121121return MaterialApp(
122- supportedLocales: [
123- Locale('de'),
124- Locale('en'),
125- Locale('es'),
126- Locale('fr'),
127- Locale('it'),
128- ...
129- ],
130- localizationsDelegates: [
131- GlobalMaterialLocalizations.delegate,
132- GlobalWidgetsLocalizations.delegate,
133- FormBuilderLocalizations.delegate,
134- ],
122+ supportedLocales: [
123+ Locale('de'),
124+ Locale('en'),
125+ Locale('es'),
126+ Locale('fr'),
127+ Locale('it'),
128+ ...
129+ ],
130+ localizationsDelegates: [
131+ GlobalMaterialLocalizations.delegate,
132+ GlobalWidgetsLocalizations.delegate,
133+ FormBuilderLocalizations.delegate,
134+ ],
135135```
136136
137137### Basic use
138138
139139``` dart
140140TextFormField(
141- decoration: InputDecoration(labelText: 'Name'),
142- autovalidateMode: AutovalidateMode.always,
143- validator: FormBuilderValidators.required(),
141+ decoration: InputDecoration(labelText: 'Name'),
142+ autovalidateMode: AutovalidateMode.always,
143+ validator: FormBuilderValidators.required(),
144144),
145145```
146146
@@ -158,28 +158,28 @@ Example:
158158
159159``` dart
160160TextFormField(
161- decoration: InputDecoration(labelText: 'Age'),
162- keyboardType: TextInputType.number,
163- autovalidateMode: AutovalidateMode.always,
164- validator: FormBuilderValidators.compose([
165- /// Makes this field required
166- FormBuilderValidators.required(),
167-
168- /// Ensures the value entered is numeric - with a custom error message
169- FormBuilderValidators.numeric(errorText: 'La edad debe ser numérica.'),
170-
171- /// Sets a maximum value of 70
172- FormBuilderValidators.max(70),
173-
174- /// Include your own custom `FormFieldValidator` function, if you want
175- /// Ensures positive values only. We could also have used `FormBuilderValidators.min(0)` instead
176- (val) {
177- final number = int.tryParse(val);
178- if (number == null) return null;
179- if (number < 0) return 'We cannot have a negative age';
180- return null;
181- }
182- ]),
161+ decoration: InputDecoration(labelText: 'Age'),
162+ keyboardType: TextInputType.number,
163+ autovalidateMode: AutovalidateMode.always,
164+ validator: FormBuilderValidators.compose([
165+ /// Makes this field required
166+ FormBuilderValidators.required(),
167+
168+ /// Ensures the value entered is numeric - with a custom error message
169+ FormBuilderValidators.numeric(errorText: 'La edad debe ser numérica.'),
170+
171+ /// Sets a maximum value of 70
172+ FormBuilderValidators.max(70),
173+
174+ /// Include your own custom `FormFieldValidator` function, if you want
175+ /// Ensures positive values only. We could also have used `FormBuilderValidators.min(0)` instead
176+ (val) {
177+ final number = int.tryParse(val);
178+ if (number == null) return null;
179+ if (number < 0) return 'We cannot have a negative age';
180+ return null;
181+ }
182+ ]),
183183),
184184```
185185
0 commit comments