Skip to main content

Bottom Sheet Select

C2CBottomSheetSelect is a custom Flutter widget designed for displaying a bottom sheet that allows users to select an item or multiple items from a provided list. It supports single and multiple selection modes, customizable styles, optional filtering, and various callbacks for handling changes and customizations.

Installation

cpub add c2c_select

or

flutter pub add c2c_select --hosted-url=https://pub.csp.scrum-dev.com

Example Usage

C2CBottomSheetSelect<String>(
items: [
C2CSelectItem(value: "apple", label: "Apple"),
C2CSelectItem(value: "banana", label: "Banana"),
// Add more items
],
onChanged: (selectedValue) {
print("Selected Value: $selectedValue");
},
label: "Select Fruit",
placeholder: "Choose...",
enableFilter: true,
)

Properties

PropertyDescriptionType
itemsThe list of items to select from.List<C2CSelectItem<T>>
valuesThe currently selected values (used in multiple mode).List<T>?
textStyleThe text style for the TextField.TextStyle?
controllerController for the select widget.C2CBottomSheetSelectController?
errorError message or widget to display.dynamic
onFocusCallbacks for focus events.VoidCallback?
onBlurCallbacks for blur events.VoidCallback?
enabledWhether the widget is enabled.bool
leftIconIcons on the left side of the select box.Widget?
rightIconIcons on the right side of the select box.Widget?
leftIconPaddingPadding for the right icons.EdgeInsets?
rightIconPaddingPadding for the right icons.EdgeInsets?
scrollPaddingPadding for scrolling.EdgeInsets?
labelLabel for the select box.dynamic
helperTextHelper text below the select box.dynamic
isRequiredIf true, the field is marked as required.bool
labelStyle/asteriskStyle/errorStyle/helperStyleStyles for label, asterisk, error, and helper text.TextStyle?
errorMaxLinesMaximum lines for error text.int?
helperMaxLinesMaximum lines for helper text.int?
bottomSheetMaxHeightMax height for the bottom sheet.double?
headerHeader widget for the bottom sheet.Widget?
isExpandedExpands the bottom sheet to full height if true.bool
itemTextStyleText style for items in the bottom sheet.TextStyle?
bottomSheetBackgroundColorBackground color of the bottom sheet.Color?
bottomSheetBorderRadiusBorder radius of the bottom sheet.double?
enableFilterEnables a filter text box if true.bool
typeType of selection (single/multiple).SelectType
onValueChangedCallback when the value changes.ValueChanged<List<T>?>?
placeholderPlaceholder text for the select box.String?
borderRadiusBorder radius for the select box.BorderRadius?
searchBoxBuilderBuilder for custom search box.C2CSearchBoxBuilder?
searchBoxPlaceholderPlaceholder for the search box.String?
handleCustomCustom handler widget.Widget?
selectItemBuilderBuilder for custom item rendering.C2CSelectItemBuilder?
listControllerController for the item list.ScrollController?
footerBuilderBuilder for custom footer.Widget Function(BuildContext context, Function() handleSubmit)?
submitTextText for the submit button.String?
checkboxColorColor of checkboxes (in multiple mode).Color?
itemBackgroundColorBackground colors for items.Color?
selectedItemBackgroundColorBackground colors for selected item.Color?
submitWhenEmptySubmits even if no item is selected.bool