getDefaultEmptyStateView static method
dynamic
getDefaultEmptyStateView(
- BuildContext context,
- CometChatColorPalette colorPalette,
- CometChatTypography typography,
- CometChatSpacing spacing, {
- String? emptyStateText,
- Color? emptyStateTextColor,
- TextStyle? emptyStateTextStyle,
- String? emptyStateSubtitle,
- Color? emptyStateSubtitleColor,
- TextStyle? emptyStateSubtitleStyle,
- Widget? icon,
Implementation
static getDefaultEmptyStateView(
BuildContext context,
CometChatColorPalette colorPalette,
CometChatTypography typography,
CometChatSpacing spacing,
{
String? emptyStateText,
Color? emptyStateTextColor,
TextStyle? emptyStateTextStyle,
String? emptyStateSubtitle,
Color? emptyStateSubtitleColor,
TextStyle? emptyStateSubtitleStyle,
Widget? icon,
}
){
return Center(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: spacing.padding10 ?? 0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
icon ?? const SizedBox(),
const SizedBox(height: 30),
Text(
emptyStateText ?? "",
textAlign: TextAlign.center,
style: TextStyle(
color: emptyStateTextColor ?? colorPalette.textPrimary,
fontSize: typography.heading3?.bold?.fontSize,
fontWeight: typography.heading3?.bold?.fontWeight,
fontFamily: typography.heading3?.bold?.fontFamily,
)
.merge(emptyStateTextStyle)
.copyWith(color: emptyStateTextColor),
),
Text(
emptyStateSubtitle ?? "",
textAlign: TextAlign.center,
style: TextStyle(
color: emptyStateSubtitleColor ??
colorPalette.textSecondary,
fontSize: typography.body?.regular?.fontSize,
fontWeight: typography.body?.regular?.fontWeight,
fontFamily: typography.body?.regular?.fontFamily,
)
.merge(
emptyStateSubtitleStyle,
)
.copyWith(
color: emptyStateSubtitleColor,
),
),
],
),
),
);
}