Skip to content

Commit 6ae1060

Browse files
committed
v1.3.1
1 parent dcdb31b commit 6ae1060

File tree

4 files changed

+88
-82
lines changed

4 files changed

+88
-82
lines changed

.idea/workspace.xml

Lines changed: 78 additions & 70 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [1.3.1] - 17-Dec-2018
2+
* Moved ChipsInput into own library on pub.dartlang.org, check it out [here](https://pub.dartlang.org/packages/flutter_chips_input)
3+
* Updated example code to include proper use of Form's `onChanged` function after update
4+
15
## [1.3.0] - 15-Dec-2018
26
* Fixed bug where TypeAhead value reset when other fields are updated
37
* `onChanged` function for FormBuilder is now called with current form values (breaking change)

example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class MyApp extends StatelessWidget {
99
return new MaterialApp(
1010
title: 'Flutter FormBuilder Demo',
1111
theme: new ThemeData(
12-
primarySwatch: Colors.green,
12+
primarySwatch: Colors.blue,
1313
),
1414
home: new MyHomePage(),
1515
);

lib/src/form_builder.dart

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,13 @@ class FormBuilder extends StatefulWidget {
3434
// assert(duplicateAttributes(controls).length == 0, "Duplicate attribute names not allowed");
3535

3636
//TODO: Find way to assert no duplicates in control attributes
37-
/*final Function duplicateAttributes = (List<FormBuilderInput> controls) {
38-
Map<String, int> attributeMap = {};
37+
/*Function duplicateAttributes = (List<FormBuilderInput> controls) {
38+
List<String> attributeList = [];
3939
controls.forEach((c) {
40-
if (attributeMap["${c.attribute}"] == null)
41-
attributeMap["${c.attribute}"] = 1;
42-
else
43-
attributeMap["${c.attribute}"] += 1;
40+
attributeList.add(c.attribute);
4441
});
45-
List<String> duplicates = [];
46-
attributeMap.forEach((k, v) {
47-
if (v > 1) duplicates.add(k);
48-
});
49-
return duplicates;
42+
List<String> uniqueAttributes = Set.from(attributeList).toList(growable: false);
43+
//attributeList.
5044
};*/
5145

5246
@override

0 commit comments

Comments
 (0)