We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3b89abc + 9092da1 commit 9fdc973Copy full SHA for 9fdc973
lib/src/form_builder.dart
@@ -73,7 +73,6 @@ class FormBuilder extends StatefulWidget {
73
}
74
75
class FormBuilderState extends State<FormBuilder> {
76
- //TODO: Find way to assert no duplicates in field names
77
final _formKey = GlobalKey<FormState>();
78
79
Map<String, FormBuilderFieldState> _fields;
@@ -114,10 +113,12 @@ class FormBuilderState extends State<FormBuilder> {
114
113
115
116
void registerField(String name, FormBuilderFieldState field) {
+ assert(!_fields.containsKey(name));
117
_fields[name] = field;
118
119
120
void unregisterField(String name) {
121
+ assert(_fields.containsKey(name));
122
_fields.remove(name);
123
124
0 commit comments