Skip to content

Commit 0fbe354

Browse files
committed
Added an extra deprecated annotation so that users are alerted to the deprecation of label. (I noticed that my code was not alerting with the deprecation only on the field declaration.)
1 parent 882fa7f commit 0fbe354

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/src/form_builder_field_option.dart

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@ class FormBuilderFieldOption extends StatelessWidget {
88

99
const FormBuilderFieldOption({
1010
Key key,
11-
this.label,
12-
@required this.value,
11+
@Deprecated('Use `child` instead. Will be removed in the next major version.')
12+
// ignore: deprecated_member_use_from_same_package
13+
this.label,
14+
@required
15+
this.value,
1316
this.child,
14-
}) : assert(label == null || child == null),
17+
}) :
18+
// ignore: deprecated_member_use_from_same_package
19+
assert(label == null || child == null),
1520
super(key: key);
1621

1722
@override

0 commit comments

Comments
 (0)