Skip to content

Commit 9db2c5f

Browse files
committed
Remove LocationField, https://pub.dev/packages/form_builder_map_field to be used. Fixes #491
1 parent 8675be8 commit 9db2c5f

13 files changed

+117
-637
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## [4.0.0-pre.7] - 18-Nov-2020
2+
* **BREAKING CHANGE**: Removed FormBuilderLocationField. Version 1 of [form_builder_map_field](https://pub.dev/packages/form_builder_map_field) to be used. Closes #491
3+
14
## [4.0.0-pre.6] - 13-Nov-2020
25
* **BREAKING CHANGE**: Attribute `readOnly` replaced by `enabled` - this was done to match Flutter's `FormField` naming convention
36
* **BREAKING CHANGE**: To programatically set values use original `didChange()` method instead of `patchValue()`

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ To use this plugin, add `flutter_form_builder` as a
2020
Improvements:
2121
* Internationalized default error texts for inbuilt validators - Help wanted to do even more in translating to more languages.
2222
* Ability to programmatically induce an error to a field - could be especially useful for server-side validation.
23-
* New field types including: LocationField, SearchableDropdown and FilePickerField
23+
* New field types including: SearchableDropdown and FilePickerField
2424
* Better composition of validators.
2525

2626
Breaking changes:
@@ -444,7 +444,7 @@ _formKey.currentState.fields['color_picker'].didChange(Colors.black);
444444
```
445445
Or multiple fields value like so:
446446
```dart
447-
_formKey.currentState.didChange({
447+
_formKey.currentState.patchValue({
448448
'age': '50',
449449
'slider': 6.7,
450450
'filter_chip': ['Test 1'],

example/lib/sources/complete_form.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@ class CompleteFormState extends State<CompleteForm> {
4848
items: allCountries,
4949
onChanged: _onChanged,
5050
),
51-
FormBuilderLocationField(
52-
name: 'location',
53-
decoration: InputDecoration(labelText: 'Location'),
54-
onChanged: _onChanged,
55-
),
5651
const SizedBox(height: 15),
5752
FormBuilderFilterChip(
5853
name: 'filter_chip',

lib/flutter_form_builder.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ library flutter_form_builder;
22

33
// export 'package:country_code_picker/country_code_picker.dart';
44
export 'package:flutter_typeahead/flutter_typeahead.dart';
5-
export 'package:google_maps_flutter/google_maps_flutter.dart';
65
export 'package:signature/signature.dart';
76
export 'package:dropdown_search/dropdown_search.dart' hide ErrorBuilder;
87

@@ -18,7 +17,6 @@ export './src/fields/form_builder_dropdown.dart';
1817
export './src/fields/form_builder_file_picker.dart';
1918
export './src/fields/form_builder_filter_chips.dart';
2019
export './src/fields/form_builder_image_picker.dart';
21-
export './src/fields/form_builder_location_field.dart';
2220
export './src/fields/form_builder_phone_field.dart';
2321
export './src/fields/form_builder_radio_group.dart';
2422
export './src/fields/form_builder_range_slider.dart';

lib/l10n/messages_all.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ MessageLookupByLibrary _findExact(String localeName) {
4646
/// User programs should call this before using [localeName] for messages.
4747
Future<bool> initializeMessages(String localeName) async {
4848
var availableLocale = Intl.verifiedLocale(
49-
localeName,
50-
(locale) => _deferredLibraries[locale] != null,
51-
onFailure: (_) => null);
49+
localeName, (locale) => _deferredLibraries[locale] != null,
50+
onFailure: (_) => null);
5251
if (availableLocale == null) {
5352
return new Future.value(false);
5453
}
@@ -68,8 +67,8 @@ bool _messagesExistFor(String locale) {
6867
}
6968

7069
MessageLookupByLibrary _findGeneratedMessagesFor(String locale) {
71-
var actualLocale = Intl.verifiedLocale(locale, _messagesExistFor,
72-
onFailure: (_) => null);
70+
var actualLocale =
71+
Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null);
7372
if (actualLocale == null) return null;
7473
return _findExact(actualLocale);
7574
}

lib/l10n/messages_en.dart

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,35 @@ class MessageLookup extends MessageLookupByLibrary {
2121

2222
static m0(max) => "Value must be less than or equal to ${max}";
2323

24-
static m1(maxLength) => "Value must have a length less than or equal to ${maxLength}";
24+
static m1(maxLength) =>
25+
"Value must have a length less than or equal to ${maxLength}";
2526

2627
static m2(min) => "Value must be greater than or equal to ${min}.";
2728

28-
static m3(minLength) => "Value must have a length greater than or equal to ${minLength}";
29+
static m3(minLength) =>
30+
"Value must have a length greater than or equal to ${minLength}";
2931

3032
final messages = _notInlinedMessages(_notInlinedMessages);
31-
static _notInlinedMessages(_) => <String, Function> {
32-
"creditCardErrorText" : MessageLookupByLibrary.simpleMessage("This field requires a valid credit card number."),
33-
"dateStringErrorText" : MessageLookupByLibrary.simpleMessage("This field requires a valid date string."),
34-
"emailErrorText" : MessageLookupByLibrary.simpleMessage("This field requires a valid email address."),
35-
"ipErrorText" : MessageLookupByLibrary.simpleMessage("This field requires a valid IP."),
36-
"matchErrorText" : MessageLookupByLibrary.simpleMessage("Value does not match pattern."),
37-
"maxErrorText" : m0,
38-
"maxLengthErrorText" : m1,
39-
"minErrorText" : m2,
40-
"minLengthErrorText" : m3,
41-
"numericErrorText" : MessageLookupByLibrary.simpleMessage("Value must be numeric."),
42-
"requiredErrorText" : MessageLookupByLibrary.simpleMessage("This field cannot be empty."),
43-
"urlErrorText" : MessageLookupByLibrary.simpleMessage("This field requires a valid URL address.")
44-
};
33+
static _notInlinedMessages(_) => <String, Function>{
34+
"creditCardErrorText": MessageLookupByLibrary.simpleMessage(
35+
"This field requires a valid credit card number."),
36+
"dateStringErrorText": MessageLookupByLibrary.simpleMessage(
37+
"This field requires a valid date string."),
38+
"emailErrorText": MessageLookupByLibrary.simpleMessage(
39+
"This field requires a valid email address."),
40+
"ipErrorText": MessageLookupByLibrary.simpleMessage(
41+
"This field requires a valid IP."),
42+
"matchErrorText": MessageLookupByLibrary.simpleMessage(
43+
"Value does not match pattern."),
44+
"maxErrorText": m0,
45+
"maxLengthErrorText": m1,
46+
"minErrorText": m2,
47+
"minLengthErrorText": m3,
48+
"numericErrorText":
49+
MessageLookupByLibrary.simpleMessage("Value must be numeric."),
50+
"requiredErrorText":
51+
MessageLookupByLibrary.simpleMessage("This field cannot be empty."),
52+
"urlErrorText": MessageLookupByLibrary.simpleMessage(
53+
"This field requires a valid URL address.")
54+
};
4555
}

lib/l10n/messages_es.dart

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,35 @@ class MessageLookup extends MessageLookupByLibrary {
2121

2222
static m0(max) => "El valor debe ser menor o igual que ${max}.";
2323

24-
static m1(maxLength) => "El valor debe tener una longitud menor o igual a ${maxLength}";
24+
static m1(maxLength) =>
25+
"El valor debe tener una longitud menor o igual a ${maxLength}";
2526

2627
static m2(min) => "El valor debe ser mayor o igual que ${min}.";
2728

28-
static m3(minLength) => "El valor debe tener una longitud mayor o igual a ${minLength}";
29+
static m3(minLength) =>
30+
"El valor debe tener una longitud mayor o igual a ${minLength}";
2931

3032
final messages = _notInlinedMessages(_notInlinedMessages);
31-
static _notInlinedMessages(_) => <String, Function> {
32-
"creditCardErrorText" : MessageLookupByLibrary.simpleMessage("Este campo requiere un número de tarjeta de crédito válido."),
33-
"dateStringErrorText" : MessageLookupByLibrary.simpleMessage("Este campo requiere una cadena de fecha válida."),
34-
"emailErrorText" : MessageLookupByLibrary.simpleMessage("Este campo requiere una dirección de correo electrónico válida."),
35-
"ipErrorText" : MessageLookupByLibrary.simpleMessage("Este campo requiere una IP válida."),
36-
"matchErrorText" : MessageLookupByLibrary.simpleMessage("El valor no coincide con el patrón requerido."),
37-
"maxErrorText" : m0,
38-
"maxLengthErrorText" : m1,
39-
"minErrorText" : m2,
40-
"minLengthErrorText" : m3,
41-
"numericErrorText" : MessageLookupByLibrary.simpleMessage("El valor debe ser numérico."),
42-
"requiredErrorText" : MessageLookupByLibrary.simpleMessage("Este campo no puede estar vacío."),
43-
"urlErrorText" : MessageLookupByLibrary.simpleMessage("Este campo requiere una dirección URL válida.")
44-
};
33+
static _notInlinedMessages(_) => <String, Function>{
34+
"creditCardErrorText": MessageLookupByLibrary.simpleMessage(
35+
"Este campo requiere un número de tarjeta de crédito válido."),
36+
"dateStringErrorText": MessageLookupByLibrary.simpleMessage(
37+
"Este campo requiere una cadena de fecha válida."),
38+
"emailErrorText": MessageLookupByLibrary.simpleMessage(
39+
"Este campo requiere una dirección de correo electrónico válida."),
40+
"ipErrorText": MessageLookupByLibrary.simpleMessage(
41+
"Este campo requiere una IP válida."),
42+
"matchErrorText": MessageLookupByLibrary.simpleMessage(
43+
"El valor no coincide con el patrón requerido."),
44+
"maxErrorText": m0,
45+
"maxLengthErrorText": m1,
46+
"minErrorText": m2,
47+
"minLengthErrorText": m3,
48+
"numericErrorText":
49+
MessageLookupByLibrary.simpleMessage("El valor debe ser numérico."),
50+
"requiredErrorText": MessageLookupByLibrary.simpleMessage(
51+
"Este campo no puede estar vacío."),
52+
"urlErrorText": MessageLookupByLibrary.simpleMessage(
53+
"Este campo requiere una dirección URL válida.")
54+
};
4555
}

lib/l10n/messages_fr.dart

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,35 @@ class MessageLookup extends MessageLookupByLibrary {
2121

2222
static m0(max) => "La valeur doit être inférieure ou égale à ${max}";
2323

24-
static m1(maxLength) => "La valeur doit avoir une longueur inférieure ou égale à ${maxLength}";
24+
static m1(maxLength) =>
25+
"La valeur doit avoir une longueur inférieure ou égale à ${maxLength}";
2526

2627
static m2(min) => "La valeur doit être supérieure ou égale à ${min}.";
2728

28-
static m3(minLength) => "La valeur doit avoir une longueur supérieure ou égale à ${minLength}";
29+
static m3(minLength) =>
30+
"La valeur doit avoir une longueur supérieure ou égale à ${minLength}";
2931

3032
final messages = _notInlinedMessages(_notInlinedMessages);
31-
static _notInlinedMessages(_) => <String, Function> {
32-
"creditCardErrorText" : MessageLookupByLibrary.simpleMessage("Ce champ nécessite un numéro de carte de crédit valide."),
33-
"dateStringErrorText" : MessageLookupByLibrary.simpleMessage("Ce champ nécessite une chaîne de date valide."),
34-
"emailErrorText" : MessageLookupByLibrary.simpleMessage("Ce champ nécessite une adresse e-mail valide."),
35-
"ipErrorText" : MessageLookupByLibrary.simpleMessage("Ce champ nécessite une adresse IP valide."),
36-
"matchErrorText" : MessageLookupByLibrary.simpleMessage("La valeur ne correspond pas au modèle."),
37-
"maxErrorText" : m0,
38-
"maxLengthErrorText" : m1,
39-
"minErrorText" : m2,
40-
"minLengthErrorText" : m3,
41-
"numericErrorText" : MessageLookupByLibrary.simpleMessage("La valeur doit être numérique."),
42-
"requiredErrorText" : MessageLookupByLibrary.simpleMessage("Ce champ ne peut pas être vide."),
43-
"urlErrorText" : MessageLookupByLibrary.simpleMessage("Ce champ nécessite une adresse URL valide.")
44-
};
33+
static _notInlinedMessages(_) => <String, Function>{
34+
"creditCardErrorText": MessageLookupByLibrary.simpleMessage(
35+
"Ce champ nécessite un numéro de carte de crédit valide."),
36+
"dateStringErrorText": MessageLookupByLibrary.simpleMessage(
37+
"Ce champ nécessite une chaîne de date valide."),
38+
"emailErrorText": MessageLookupByLibrary.simpleMessage(
39+
"Ce champ nécessite une adresse e-mail valide."),
40+
"ipErrorText": MessageLookupByLibrary.simpleMessage(
41+
"Ce champ nécessite une adresse IP valide."),
42+
"matchErrorText": MessageLookupByLibrary.simpleMessage(
43+
"La valeur ne correspond pas au modèle."),
44+
"maxErrorText": m0,
45+
"maxLengthErrorText": m1,
46+
"minErrorText": m2,
47+
"minLengthErrorText": m3,
48+
"numericErrorText": MessageLookupByLibrary.simpleMessage(
49+
"La valeur doit être numérique."),
50+
"requiredErrorText": MessageLookupByLibrary.simpleMessage(
51+
"Ce champ ne peut pas être vide."),
52+
"urlErrorText": MessageLookupByLibrary.simpleMessage(
53+
"Ce champ nécessite une adresse URL valide.")
54+
};
4555
}

lib/l10n/messages_messages.dart

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,38 @@ class MessageLookup extends MessageLookupByLibrary {
2323

2424
static m0(max) => "Value must be less than or equal to ${max}";
2525

26-
static m1(maxLength) => "Value must have a length less than or equal to ${maxLength}";
26+
static m1(maxLength) =>
27+
"Value must have a length less than or equal to ${maxLength}";
2728

2829
static m2(min) => "Value must be greater than or equal to ${min}.";
2930

30-
static m3(minLength) => "Value must have a length greater than or equal to ${minLength}";
31+
static m3(minLength) =>
32+
"Value must have a length greater than or equal to ${minLength}";
3133

3234
final messages = _notInlinedMessages(_notInlinedMessages);
33-
static _notInlinedMessages(_) => <String, Function> {
34-
"creditCardErrorText" : MessageLookupByLibrary.simpleMessage("This field requires a valid credit card number."),
35-
"dateStringErrorText" : MessageLookupByLibrary.simpleMessage("This field requires a valid date string."),
36-
"emailErrorText" : MessageLookupByLibrary.simpleMessage("This field requires a valid email address."),
37-
"equalErrorText" : m4,
38-
"integerErrorText" : MessageLookupByLibrary.simpleMessage("Value must be an integer."),
39-
"ipErrorText" : MessageLookupByLibrary.simpleMessage("This field requires a valid IP."),
40-
"matchErrorText" : MessageLookupByLibrary.simpleMessage("Value does not match pattern."),
41-
"maxErrorText" : m0,
42-
"maxLengthErrorText" : m1,
43-
"minErrorText" : m2,
44-
"minLengthErrorText" : m3,
45-
"numericErrorText" : MessageLookupByLibrary.simpleMessage("Value must be numeric."),
46-
"requiredErrorText" : MessageLookupByLibrary.simpleMessage("This field cannot be empty."),
47-
"urlErrorText" : MessageLookupByLibrary.simpleMessage("This field requires a valid URL address.")
48-
};
35+
static _notInlinedMessages(_) => <String, Function>{
36+
"creditCardErrorText": MessageLookupByLibrary.simpleMessage(
37+
"This field requires a valid credit card number."),
38+
"dateStringErrorText": MessageLookupByLibrary.simpleMessage(
39+
"This field requires a valid date string."),
40+
"emailErrorText": MessageLookupByLibrary.simpleMessage(
41+
"This field requires a valid email address."),
42+
"equalErrorText": m4,
43+
"integerErrorText":
44+
MessageLookupByLibrary.simpleMessage("Value must be an integer."),
45+
"ipErrorText": MessageLookupByLibrary.simpleMessage(
46+
"This field requires a valid IP."),
47+
"matchErrorText": MessageLookupByLibrary.simpleMessage(
48+
"Value does not match pattern."),
49+
"maxErrorText": m0,
50+
"maxLengthErrorText": m1,
51+
"minErrorText": m2,
52+
"minLengthErrorText": m3,
53+
"numericErrorText":
54+
MessageLookupByLibrary.simpleMessage("Value must be numeric."),
55+
"requiredErrorText":
56+
MessageLookupByLibrary.simpleMessage("This field cannot be empty."),
57+
"urlErrorText": MessageLookupByLibrary.simpleMessage(
58+
"This field requires a valid URL address.")
59+
};
4960
}

0 commit comments

Comments
 (0)