CheckboxListTile

The CheckboxListTile is a combination of Checkbox and ListTile. Tapping anywhere on the CheckboxListTile toggles the checkbox.

You can use the CheckboxListTile to show a list of ToDo items to mark them as complete.

Add a CheckboxListTile to Your Project

Here's an example of how you can use a CheckboxListTile widget in your project:

  1. First, drag the ListView widget from the Layout Elements tab (in the Widget Panel) or add it directly from the widget tree.

  2. Drag the CheckboxListTile widget from the Base Elements tab and drop it inside the ListView.

  3. Select CheckboxListTile from the widget tree or from the canvas area.

  4. Move to the Property Editor and scroll down to the Title section.

  5. Change the Text property to Task.

  6. Scroll down below and find the Subtitle section. Change the property to the Description.

At this point, you have one item added to the list. To fill the ListView with more items simply copy-paste the CheckboxListTile widget.

To copy-paste the CheckboxListTile widget:

  1. Select the CheckboxListTile widget.

  2. Right-click on it and select Copy. You can also use the keyboard shortcut Ctrl+C or Command+C.

  3. Select the ListView widget.

  4. Right-click on it and select Paste. You can also use the keyboard shortcut Ctrl+V or Command+V.

After adding a number of items, the list created using CheckboxListTile looks like this:

Customizing

You can customize the appearance and behavior of this widget using the various properties available under the properties panel.

Setting Checkbox Initial Value

By default, CheckboxListTile comes with the checked checkbox. However, You can change this behavior to show the unchecked checkbox initially.

To set the check or uncheck value to the checkbox:

  1. Select CheckboxListTile from the widget tree or from the canvas area.

  2. Move to the Property Editor and scroll down to the Checkbox List Tile Properties section.

  3. Check/Uncheck the Checkbox Initial Value property (click on it).

Changing Tile Color

To change the Tile color:

  1. Select CheckboxListTile from the widget tree or from the canvas area.

  2. Move to the Property Editor and scroll down to the Checkbox List Tile Properties section.

  3. Find the Tile Color property and click on the box next to Unset, select the color, and then click Use Selected Color or click on Unset and enter a Hex Code directly. You can also choose the color by clicking on the Palette and Simple button.

Styling Checkbox

By default, the checkbox comes in a square shape having a blue background and white color for the icon. You can change this default setting to customize the checkbox using the properties available under the Checkbox List Tile Properties section.

Changing Checkbox Color

To change the Checkbox color:

  1. Select CheckboxListTile from the widget tree or from the canvas area.

  2. Move to the Property Editor and scroll down to the Checkbox List Tile Properties section.

  3. Find the Active Color property and click on the box next to Unset, select the color, and then click Use Selected Color or click on Unset and enter a Hex Code directly. You can also choose the color by clicking on the Palette and Simple button.

  4. Find the Check Color property and click on the box next to Unset, select the color, and then click Use Selected Color or click on Unset and enter a Hex Code directly. You can also choose the color by clicking on the Palette and Simple button.

Making Checkbox Circular

To make the checkbox circular in shape:

  1. Select CheckboxListTile from the widget tree or from the canvas area.

  2. Move to the Property Editor and scroll down to the Checkbox List Tile Properties section.

  3. Scroll down and checkmark the Circular Check property. Click on it.

Showing Checkbox At Start

To make the checkbox appear before the title:

  1. Select CheckboxListTile from the widget tree or from the canvas area.

  2. Move to the Property Editor and scroll down to the Checkbox List Tile Properties section.

  3. Scroll down and checkmark the Leading property. Click on it.

Disable CheckboxListTile

You may need to disable a CheckboxListTile if certain conditions aren't met. For instance, users should only be able to use the 'Same as Shipping Address' checkbox when a shipping address is provided.

To disable a CheckboxListTile, move to the Properties Panel > turn on the Checkbox Disable Options > click Unset, and set the Condition. Once set, you could also customize the disabled state colors using the Disabled Check Color property.

Styling The CheckboxListTile

Using various properties under the Style Properties section, you can customize the CheckboxListTile as per your design.

Here are the instructions on styling the CheckboxListTile.

Customizing The Title

Here are the instructions on customizing the title.

Customizing The Subtitle

Here are the instructions on customizing the subtitle.

Common widget properties

See how to work with Widget Styling, Visibility, Padding & Alignment, and Testing.

Showing Firestore Data

To show the data retrieved from your Firestore collection and document into the ChcekboxListTile widget, ensure you:

  1. Completed all steps in the Firebase Setup section for your project.

  2. Retrieved Data from either collection or document.

  3. Finally, to show data into the CheckboxListTile widget, follow the steps here.


Last Updated Date: December 13, 2023

Last updated