getErrorText static method

Widget getErrorText(
  1. BuildContext context,
  2. CometChatColorPalette colorPalette,
  3. CometChatTypography typography,
  4. CometChatSpacing spacing, {
  5. String? errorStateText,
  6. TextStyle? errorTextStyle,
})

Implementation

static Widget getErrorText(
  BuildContext context,
  CometChatColorPalette colorPalette,
  CometChatTypography typography,
  CometChatSpacing spacing, {
  String? errorStateText,
  TextStyle? errorTextStyle,
}) {
  return Container(
    height: 116,
    alignment: Alignment.center,
    child: Text(
      errorStateText ??
          "${Translations.of(context).looksLikeSomethingWrong}\n${Translations.of(context).pleaseTryAgain}.",
      textAlign: TextAlign.center,
      style: TextStyle(
        fontSize: typography.body?.regular?.fontSize,
        fontWeight: typography.body?.regular?.fontWeight,
        fontFamily: typography.body?.regular?.fontFamily,
        color: colorPalette.textSecondary,
      ).merge(errorTextStyle),
    ),
  );
}