getDefaultEmptyStateView static method

Center getDefaultEmptyStateView(
  1. BuildContext context,
  2. CometChatColorPalette colorPalette,
  3. CometChatTypography typography,
  4. CometChatSpacing spacing, {
  5. String? emptyStateText,
  6. Color? emptyStateTextColor,
  7. TextStyle? emptyStateTextStyle,
  8. String? emptyStateSubtitle,
  9. Color? emptyStateSubtitleColor,
  10. TextStyle? emptyStateSubtitleStyle,
  11. Widget? icon,
})

Implementation

static Center 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),
          ),
        ],
      ),
    ),
  );
}