Skip to main content

List Base

CometChatListBase is a scaffolding widget which displays contents passed as child used across CometChatConversations, CometChatGroups & CometChatUsers.


Usage

CometChatListBase(
title: "Title",
container: <childWidget>,
);

Parameters

ParameterTypeDescription
titleStringUsed to set title in the app bar
styleListBaseStyleUsed to set style for the component
showBackButtonboolUsed to toggle visibility of backButton
placeholderStringplaceholder for search text field
backIconWidgetUsed to update back button
hideSearchboolUsed to toggle search bar visibility
searchBoxIconWidgetUsed to alter searchBox
containerWidgetUsed to Give. child widget to list base
menuOptionsList<Widget>used to give menu options visible at top right corner
onSearchFunction(String val)Function which will be triggered when click on search icon
searchTextStringif passed this text will be preloaded
onBackVoidCallbackused to set a call back triggered on tapping the back button in the app bar
Example
CometChatListBase(
title: <title>,
hideSearch: <hideSearch>,
backIcon: <backIcon>,
placeholder: <placeholder>,
showBackButton: <showBackButton>,
searchBoxIcon: <searchBoxIcon>,
onSearch: (String search){
// Will evaluate when click on search icon
},
searchText: <searchText>,
theme: <theme>,
style: <style>,
container: <childWidget> // Replace with your child widget
menuOptions: [
// List of menuOptions
],
);

Style

style is an instance of ListBaseStyle and responsible for styling of CometChatListBase

PropertiesTypeDescription
backgroundColorused to set background color
borderBoxBorderused to set border
borderRadiusdoubleused to modify the border radius
titleStyleTextStyleused to set title style
searchBoxRadiusdoubleused to set the search box radius
searchTextStyleTextStyleused to set search field text style
searchPlaceholderStyleTextStyleused to set text style of hint text in the search field
searchBorderWidthdoubleused to set search text field border width
searchBorderColorColorused to set the search text field border color
searchBoxBackgroundColorused to set the search text field background color
searchIconTintColorused to set the search text field border color
backIconTintColorused to set the color of back icon
gradientGradientused to set gradient background
heightdoubleused to set height
widthdoubleused to set width
ListBaseStyle _style  = ListBaseStyle(
background: <backgroundColor>,
titleStyle: <titleStyle>,
searchBorderColor: <SearchBorderColor>,
searchBorderWidth: <searchBorderWidth>,
searchBoxBackground: <SearchBoxBackgroundColor>,
searchBoxRadius: <SearchboxCornerRadius>,
searchTextStyle: <SearchTextStyle>,
);