Skip to content

Commit c964ef1

Browse files
Merge pull request #1145 from Hu-Wentao/main
feat add `OutlinedBorder shape` `BorderSide side` to FormBuilderCheckbox
2 parents d13e449 + d7a478c commit c964ef1

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

lib/src/fields/form_builder_checkbox.dart

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,22 @@ class FormBuilderCheckbox extends FormBuilderField<bool> {
6666
/// Normally, this property is left to its default value, false.
6767
final bool selected;
6868

69+
/// {@macro flutter.material.checkbox.shape}
70+
///
71+
/// If this property is null then [CheckboxThemeData.shape] of [ThemeData.checkboxTheme]
72+
/// is used. If that's null then the shape will be a [RoundedRectangleBorder]
73+
/// with a circular corner radius of 1.0.
74+
final OutlinedBorder? shape;
75+
76+
/// {@macro flutter.material.checkbox.side}
77+
///
78+
/// The given value is passed directly to [Checkbox.side].
79+
///
80+
/// If this property is null, then [CheckboxThemeData.side] of
81+
/// [ThemeData.checkboxTheme] is used. If that is also null, then the side
82+
/// will be width 2.
83+
final BorderSide? side;
84+
6985
/// Creates a single Checkbox field
7086
FormBuilderCheckbox({
7187
super.key,
@@ -97,6 +113,8 @@ class FormBuilderCheckbox extends FormBuilderField<bool> {
97113
this.shouldRequestFocus = false,
98114
this.subtitle,
99115
this.tristate = false,
116+
this.shape,
117+
this.side,
100118
}) : super(
101119
builder: (FormFieldState<bool?> field) {
102120
final state = field as _FormBuilderCheckboxState;
@@ -125,6 +143,8 @@ class FormBuilderCheckbox extends FormBuilderField<bool> {
125143
tristate: tristate,
126144
contentPadding: contentPadding,
127145
selected: selected,
146+
checkboxShape: shape,
147+
side: side,
128148
),
129149
);
130150
},

0 commit comments

Comments
 (0)