copyWith method

AISmartRepliesConfiguration copyWith({
  1. AISmartRepliesStyle? smartRepliesStyle,
  2. CometChatTheme? theme,
  3. String? emptyStateText,
  4. OnError? onError,
  5. String? errorStateText,
  6. Widget customView(
    1. List<String> replies,
    2. BuildContext context
    )?,
  7. dynamic onClick(
    1. User? user,
    2. Group? group,
    3. dynamic onSuccess(
      1. Widget,
      2. bool isLoading,
      3. BuildContext context
      ),
    4. dynamic onError(
      1. CometChatException e,
      2. bool isError,
      3. BuildContext context
      ),
    )?,
  8. String? loadingStateText,
  9. WidgetBuilder? emptyStateView,
  10. WidgetBuilder? loadingStateView,
  11. WidgetBuilder? errorStateView,
  12. String? errorIconUrl,
  13. String? emptyIconUrl,
  14. String? loadingIconUrl,
  15. Future<Map<String, dynamic>> apiConfiguration(
    1. User? user,
    2. Group? group
    )?,
})

Copies current AISmartRepliesConfiguration with some changes

Implementation

AISmartRepliesConfiguration copyWith(
    {AISmartRepliesStyle? smartRepliesStyle,
    CometChatTheme? theme,
    String? emptyStateText,
    OnError? onError,
    String? errorStateText,
    Widget Function(List<String> replies, BuildContext context)? customView,
    Function(
            User? user,
            Group? group,
            Function(Widget, bool isLoading, BuildContext context) onSuccess,
            Function(CometChatException e, bool isError, BuildContext context)
                onError)?
        onClick,
    String? loadingStateText,
    WidgetBuilder? emptyStateView,
    WidgetBuilder? loadingStateView,
    WidgetBuilder? errorStateView,
    String? errorIconUrl,
    String? emptyIconUrl,
    String? loadingIconUrl,
    Future<Map<String, dynamic>> Function(User? user, Group? group)?
        apiConfiguration}) {
  return AISmartRepliesConfiguration(
    smartRepliesStyle: smartRepliesStyle ?? this.smartRepliesStyle,
    theme: theme ?? this.theme,
    emptyStateText: emptyStateText ?? this.emptyStateText,
    onError: onError ?? this.onError,
    errorStateText: errorStateText ?? this.errorStateText,
    customView: customView ?? this.customView,
    onClick: onClick ?? this.onClick,
    loadingStateText: loadingStateText ?? this.loadingStateText,
    emptyStateView: emptyStateView ?? this.emptyStateView,
    loadingStateView: loadingStateView ?? this.loadingStateView,
    errorStateView: errorStateView ?? this.errorStateView,
    errorIconUrl: errorIconUrl ?? this.errorIconUrl,
    emptyIconUrl: emptyIconUrl ?? this.emptyIconUrl,
    loadingIconUrl: loadingIconUrl ?? this.loadingIconUrl,
    apiConfiguration: apiConfiguration ?? this.apiConfiguration,
  );
}