Skip to content

Commit 00eebae

Browse files
committed
Allow nulls in FormBuilder controls attribute
1 parent 90bf8d4 commit 00eebae

File tree

4 files changed

+712
-691
lines changed

4 files changed

+712
-691
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [2.0.2] - 26-March-2019
2+
* Allow `null`s in `FormBuilder` controls `attribute`
3+
4+
## [2.0.1] - 26-March-2019
5+
* Minor fix in documentation
6+
17
## [2.0.1] - 26-March-2019
28
* Fixed bug where fields keep losing focus
39

example/lib/main.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class MyHomePageState extends State<MyHomePage> {
2727
var data;
2828
bool autoValidate = true;
2929
bool readOnly = false;
30+
bool showSegmentedControl = true;
3031

3132
@override
3233
Widget build(BuildContext context) {
@@ -551,7 +552,7 @@ class MyHomePageState extends State<MyHomePage> {
551552
value: 1,
552553
max: 5,
553554
),
554-
FormBuilderInput.segmentedControl(
555+
showSegmentedControl ? FormBuilderInput.segmentedControl(
555556
decoration:
556557
InputDecoration(labelText: "Movie Rating (Archer)"),
557558
attribute: "movie_rating",
@@ -560,7 +561,7 @@ class MyHomePageState extends State<MyHomePage> {
560561
options: List.generate(5, (i) => i + 1)
561562
.map((number) => FormBuilderInputOption(value: number))
562563
.toList(),
563-
),
564+
) : null,
564565
],
565566
),
566567
MaterialButton(

0 commit comments

Comments
 (0)