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: README.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,8 +38,8 @@ Also included is the `l10n` / `i18n` of error text messages to multiple language
38
38
## Features
39
39
40
40
- Ready-made validation rules
41
-
-Multiple form inputs validators
42
-
- Default error messages in several languages
41
+
-Compose multiple reusable validation rules
42
+
- Default error messages in multiple languages
43
43
44
44
## Validators
45
45
@@ -136,7 +136,7 @@ return MaterialApp(
136
136
137
137
### Basic use
138
138
139
-
```dart
139
+
```Dart
140
140
TextFormField(
141
141
decoration: InputDecoration(labelText: 'Name'),
142
142
autovalidateMode: AutovalidateMode.always,
@@ -156,7 +156,7 @@ On validation, each validator is run, and if any validator returns a non-null va
156
156
157
157
Example:
158
158
159
-
```dart
159
+
```Dart
160
160
TextFormField(
161
161
decoration: InputDecoration(labelText: 'Age'),
162
162
keyboardType: TextInputType.number,
@@ -178,7 +178,7 @@ TextFormField(
178
178
if (number == null) return null;
179
179
if (number < 0) return 'We cannot have a negative age';
180
180
return null;
181
-
}
181
+
},
182
182
]),
183
183
),
184
184
```
@@ -205,27 +205,27 @@ We welcome efforts to internationalize/localize the package by translating the d
205
205
206
206
1. Add ARB files
207
207
208
-
Create one ARB file inside the `lib/l10n` folder for each locale you need to add support. Name the files in the following way: `intl_<LOCALE_ISO_CODE>.arb`. For example: `intl_fr.arb` or `intl_fr_FR.arb`.
208
+
Create one ARB file inside the `lib/l10n` folder for each locale you need to add support. Name the files in the following way: `intl_<LOCALE_ISO_CODE>.arb`. For example: `intl_fr.arb` or `intl_fr_FR.arb`.
209
209
210
210
2. Translate the error messages
211
211
212
-
Copy and paste the contents of `intl_en.arb` into your newly created ARB file. Then translate the error messages by overwriting the default messages.
212
+
Copy and paste the contents of `intl_en.arb` into your newly created ARB file. Then translate the error messages by overwriting the default messages.
213
213
214
214
3. Generate localization code
215
215
216
-
To generate boilerplate code for localization, run the generate command inside the package directory where `pubspec.yaml` file is located:
216
+
To generate boilerplate code for localization, run the generate command inside the package directory where `pubspec.yaml` file is located:
217
217
218
-
`flutter gen-l10n`
218
+
`flutter gen-l10n`
219
219
220
-
The command will automatically create/update files inside the `lib/localization` directory, including your newly added locale support.
220
+
The command will automatically create/update files inside the `lib/localization` directory, including your newly added locale support.
221
221
222
222
4. Update README
223
223
224
-
Remember to update README, adding the new language (and language code) under [Supported languages section](#supported-languages) in alphabetic order, so that everyone knows your new language is now supported!
224
+
Remember to update README, adding the new language (and language code) under [Supported languages section](#supported-languages) in alphabetic order, so that everyone knows your new language is now supported!
225
225
226
226
5. Submit PR
227
227
228
-
Submit your PR and be of help to millions of developers all over the world!
228
+
Submit your PR and be of help to millions of developers all over the world!
229
229
230
230
#### Add new validator
231
231
@@ -258,4 +258,4 @@ Take a look at [our fantastic ecosystem](https://github.com/flutter-form-builder
0 commit comments