Skip to main content

Date

CometChatDate is a widget which is used to show the date and time. You can also customize the appearance of this widget by modifying its logic.

How to integrate CometChatDate ?

Since CometChatDate is a widget, it can be added directly in the build method. CometChatDate includes various parameters to customize its UI.

Usage

CometChatDate(
date: DateTime.now(),
);

Properties

ParametersTypeDescription
dateDateTimeUsed to set the date
patternDateTimePatternUsed to set pattern with different logics

timeFormat, dayDateFormat, dayDateTimeFormat
customDateStringStringtext to show instead of date from DateTime object
styleDateStyleused to customize the appearance of this widget

DateStyle

ParametersTypeDescription
textStyleTextStyleUsed to set text style of date component
backgroundColorUsed to set the background color
borderBoxBorderused to set border
borderRadiusdoubleused to set the border radius
heightdoubleused to set the height
widthdoubleused to set width
gradientGradientused to set a gradient background
isTransparentBackgroundboolUsed to set background transparent
contentPaddingEdgeInsetsGeometryUsed to set content padding

Usage

CometChatDate(
date: DateTime.now(),
style: DateStyle(
backgroundColor: Colors.yellow,
)
);