Skip to content

Commit cf8f4b3

Browse files
committed
Added checkbox group widget
1 parent dd68c43 commit cf8f4b3

File tree

12 files changed

+124
-27
lines changed

12 files changed

+124
-27
lines changed

docs/resources/control-flow/user-interactivity/forms/form-validation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ sidebar_position: 2
99

1010
# Form Validation
1111

12-
The Form widget allows you to validate the user input and display a message if validation fails. This widget can contain any number of form fields, which are typically input fields such as [TextFields](form-widgets/textfield), [Dropdown](form-widgets/dropdown), [RadioButton](form-widgets/radiobutton), or [Date/Time picker](#).
12+
You can add validations to input fields by wrapping them inside the Form widget. The Form widget enables you to validate user inputs and display appropriate messages when validation criteria are not met.
1313

1414
For example, you could use it to check if a user has given a valid email and password. This makes it easy to handle user input and ensure that the data is correct before it is submitted to the server or stored locally.
1515

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
slug: checkboxgroup
3+
title: CheckboxGroup
4+
tags: []
5+
description: Learn how to add CheckboxGroup widget in your FlutterFlow app.
6+
sidebar_position: 3
7+
---
8+
9+
10+
# CheckboxGroup
11+
12+
The CheckboxGroup widget is used to allow a user to select multiple items. The checkbox is displayed before the item name, which you can check/uncheck to make/remove the selection.
13+
14+
You can use the CheckboxGroup widget for implementing multiple selections such as repeating days for alarm, languages a user can speak, and allowing users to select pizza toppings.
15+
16+
## Adding CheckboxGroup
17+
18+
Here's an example of how you can use the CheckboxGroup widget in your project:
19+
20+
1. First, add the **CheckboxGroup** widget from the **Form Elements** tab or add it directly from the widget tree.
21+
2. By default, the CheckboxGroup widget adds a single option named **Option 1**. To change the name, move to the properties panel (on the right side of your screen), and scroll down to the **Define Options** section. Find the **Option 1** property and change the **name**.
22+
3. To add more options, move to the properties panel, and scroll down to the **Define Options** section.
23+
1. Click on the **Add Option** text.
24+
2. Enter the name in **Option 2 Text**.
25+
4. To remove the option, click on the cancel icon displayed in the **Option name** property.
26+
5. Click on the **Set from Variable** to show the options from a variable such as app state variable, API response variable, or Firestore Document.
27+
28+
![Adding CheckboxGroup](../../imgs/adding-checkboxgroup.gif)
29+
30+
## Setting initial selection
31+
32+
Sometimes you might want to display the CheckboxGroup with some options already selected. For example, selecting the topping options that are already served with Pizza itself. You can do so by setting the initial selection for the CheckboxGroup.
33+
34+
To set initial selection manually:
35+
36+
1. Select the **CheckboxGroup** from the widget tree or the canvas area.
37+
2. Move to the properties panel (on the right side of your screen) and scroll down to the **Initially Selected** section.
38+
3. Click on the **Add Selected** and enter the option name that you would like to display as selected. **Note**: Make sure you enter the correct name and it matches with the option name added inside the define options section.
39+
4. Similarly, you can display the other option(s) as selected.
40+
41+
![Setting the initial selection manually](../../imgs/set-initial-value-manually.gif)
42+
43+
44+
## Clear/Select all items [Action]
45+
You might want to allow users to clear or select all items in one go. You can do so by adding the following action.
46+
47+
![Clear All/Select All](../../imgs/clear-all-select-all-demo.gif)
48+
49+
Follow the steps below to add this action to any widget.
50+
51+
1. Select the **Widget** (e.g., Button) on which you want to add the action.
52+
2. Select **Actions** from the properties panel (the right menu), If it's the first action, click **+ Add Action** button. Otherwise, click the "**+**" button below the previous action tile (inside *Action Flow Editor*) and select **Add Action**.
53+
3. Search and select the **Clear All/Select All** (under *Widget/UI Interactions*) action.
54+
4. **Choose Multiselect Widget** name from the dropdown.
55+
5. Finally, set the **Action Type** to **Clear All** or **Select All**.
56+
57+
![adding-clear-all-select-all-demo](../../imgs/adding-clear-all-select-all-demo.gif)
58+
59+
## Customization
60+
61+
You can use the Properties Panel to customize the appearance of your widget.
62+
63+
### Set padding around the checkbox
64+
65+
To create empty space around the checkbox:
66+
67+
1. Select the **CheckboxGroup** from the widget tree or the canvas area.
68+
2. Move to the properties panel and find the **Item Padding** property.
69+
3. Set the padding for the L(Left), T(Top), R(Right), and B(Bottom) sides. Use the Lock button to change all values at the same time. Unlocking will allow you to modify each value separately.
70+
71+
![Set padding around the checkbox](../../imgs/set-padding-around-checkbox.gif)
72+
73+
### Changing checkbox color
74+
75+
To change the checkbox color:
76+
77+
1. Select the **CheckboxGroup** from the widget tree or the canvas area.
78+
2. Move to the properties panel and scroll down to the **Checkbox Style** section.
79+
3. To change the active color (i.e. color when the checkbox is selected), find the **Active Color** property, click on the box next to the already selected color, select the color, and then click **Use Color** or click on **Unset** and enter a Hex Code directly. You can also choose the color by clicking the **Palette** and **Simple** button.
80+
4. the Similarly you can change the check color (i.e color of the done/tickmark icon inside the checkbox).
81+
82+
![Changing checkbox color](../../imgs/change-checkbox-color.gif)
83+
84+
### Customizing checkbox borde
85+
86+
To customize the checkbox border:
87+
88+
1. Select the **CheckboxGroup** from the widget tree or the canvas area.
89+
2. Move to the properties panel and scroll down to the **Checkbox Style** section.
90+
3. To change the checkbox border color, find the **Check Border Color** property, click on the box next to the already selected color, select the color, and then click **Use Color** or click on **Unset** and enter a Hex Code directly. You can also choose the color by clicking the **Palette** and **Simple** button.
91+
4. To adjust the border corner, find the **Border Radius** property and enter the values in the TL (Top left), TR (top right), BL (bottom left), and BR (bottom right) boxes. Use the Lock button to change all values at the same time. Unlocking will allow you to modify each value separately.
92+
93+
![Customizing checkbox border](../../imgs/checkbox-border.gif)
94+
95+
## Trigger action on change
96+
97+
See how to [trigger an action when a selection changes](../../../../../resources/ui-building-blocks/widgets/widget-commonalities#trigger-action-on-selection-change) on this widget.
1.3 MB
Loading
1.71 MB
Loading
2.83 MB
Loading
2.01 MB
Loading
357 KB
Loading
1.24 MB
Loading
1.89 MB
Loading

docs/resources/control-flow/user-interactivity/forms/form-widgets/pincode.md renamed to docs/resources/ui-building-blocks/components/built-in-components/pincode.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ slug: pincode
33
title: PinCode
44
tags: []
55
description: Learn how to add PinCodewidget in your FlutterFlow app.
6-
sidebar_position: 3
6+
sidebar_position: 4
77
---
88
# PinCode
99

@@ -48,7 +48,7 @@ To add a PinCode widget:
4848

4949
Let's see how to trigger an action when you are done entering the value in this widget. This is helpful when you want to compare the entered value with the one stored in your backend.
5050

51-
![Displaying a snackbar message with the entered value in PinCode widget](../../imgs/trigger-on-completed-demo.gif)
51+
![Displaying a snackbar message with the entered value in PinCode widget](../../../control-flow/user-interactivity/imgs/trigger-on-completed-demo.gif)
5252

5353
To do so:
5454

@@ -88,7 +88,7 @@ Here is an example of displaying a snackbar message that shows the entered value
8888

8989
Let's see how to trigger an action whenever you enter or delete the value in each field of this widget. This is helpful when you want to provide immediate feedback to the user. For instance, you can check the validity of the entered digit as soon as the user types it in and show a message that it is not valid.
9090

91-
![Trigger action On Change](../../imgs/trigger-action-on-change.gif)
91+
![Trigger action On Change](../../../control-flow/user-interactivity/imgs/trigger-action-on-change.gif)
9292

9393
To do so:
9494

@@ -128,11 +128,11 @@ Here is an example of displaying a snackbar message when a user enters a non-num
128128

129129
You can validate the Pincode widget to see if a user has entered any value. To do so, wrap the Pincode widget inside the [**Form**](#) widget, In the *Form* widget, enter the error message you want to display and then trigger the [**Validate Form**](#) action. This will display an error message when a user tries to submit the form without a pincode value.
130130

131-
![Pincode validation](../../imgs/pincode-validation.gif)
131+
![Pincode validation](../../../control-flow/user-interactivity/imgs/pincode-validation.gif)
132132

133133
You can also adjust the height to the error text from **Properties Panel > Error text height**.
134134

135-
![Set error text height](../../imgs/set-error-text-height.png)
135+
![Set error text height](../../../control-flow/user-interactivity/imgs/set-error-text-height.png)
136136

137137
## Customizing
138138

@@ -142,9 +142,9 @@ You can customize the appearance and behavior of this widget using the various p
142142

143143
When the keyboard opens by default, you can enter only numbers. But you might want to allow users to enter both letters and numbers. To do so, select the **PinCode** widget, move to the **Properties Panel** **> PinCode Properties >** set the **Keyboard Type** to the **Visible Password**.
144144

145-
![Keyboard Type](../../imgs/keyboard-type.webp)
145+
![Keyboard Type](../../../control-flow/user-interactivity/imgs/keyboard-type.webp)
146146

147-
![Keyboard type: Visible Password](../../imgs/keyboard-type-visible-password.png)
147+
![Keyboard type: Visible Password](../../../control-flow/user-interactivity/imgs/keyboard-type-visible-password.png)
148148

149149

150150
### Using PinCode for secret pin
@@ -243,7 +243,7 @@ When enabled, it mimics the tap event and immediately shows the keyboard. This m
243243

244244
When this is enabled, it can read and auto fill the code from your messages app.
245245

246-
![Auto Fill enabled](../../imgs/auto-fill-enabled.png)
246+
![Auto Fill enabled](../../../control-flow/user-interactivity/imgs/auto-fill-enabled.png)
247247

248248
### Aligning pin code fields
249249

@@ -259,7 +259,7 @@ The following options help you align the pin code fields:
259259
- **Space Between**: Place the free space evenly between the pin code fields.
260260
To configure the space between and around the pin fields, select the **PinCode** widget, move to the properties panel, find the **Pin Code Alignment** property and select among the above options.
261261

262-
![Aligning pin code fields](../../imgs/align-pin-code-fields.gif)
262+
![Aligning pin code fields](../../../control-flow/user-interactivity/imgs/align-pin-code-fields.gif)
263263

264264
### Changing pin field shape and size
265265

0 commit comments

Comments
 (0)