getBackButton method

Widget? getBackButton(
  1. dynamic context,
  2. CometChatTheme theme
)

returns back button to be shown in appbar

Implementation

Widget? getBackButton(context, CometChatTheme theme) {
  Widget? backButton;
  if (showBackButton != null && showBackButton == true) {
    backButton = IconButton(
        onPressed: onBack ??
            () {
              Navigator.pop(context);
            },
        color: style.backIconTint,
        icon: backIcon ??
            Image.asset(
              AssetConstants.back,
              package: UIConstants.packageName,
              color: style.backIconTint ?? theme.palette.getPrimary(),
            ));
  }
  return backButton;
}