Skip to content

Commit 791e20c

Browse files
committed
feat: add startTyping and stopTyping actions to ChatwootActionType enum
1 parent c73d516 commit 791e20c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lib/chatwoot_sdk.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export 'package:chatwoot_sdk/data/local/entity/chatwoot_conversation.dart';
44
export 'package:chatwoot_sdk/data/local/entity/chatwoot_message.dart';
55
export 'package:chatwoot_sdk/data/local/entity/chatwoot_user.dart';
66
export 'package:chatwoot_sdk/data/remote/chatwoot_client_exception.dart';
7+
export 'package:chatwoot_sdk/data/remote/requests/chatwoot_action_data.dart';
78
export 'package:chatwoot_sdk/ui/chatwoot_chat_dialog.dart';
89
export 'package:chatwoot_sdk/ui/chatwoot_chat_page.dart';
910
export 'package:chatwoot_sdk/ui/webview_widget/chatwoot_widget.dart';

lib/data/remote/requests/chatwoot_action_data.dart

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,18 @@ class ChatwootActionData {
1515
Map<String, dynamic> toJson() => _$ChatwootActionDataToJson(this);
1616
}
1717

18-
enum ChatwootActionType { subscribe, update_presence }
18+
enum ChatwootActionType { subscribe, update_presence, startTyping, stopTyping }
1919

2020
String actionTypeToJson(ChatwootActionType actionType) {
2121
switch (actionType) {
2222
case ChatwootActionType.update_presence:
2323
return "update_presence";
2424
case ChatwootActionType.subscribe:
2525
return "subscribe";
26+
case ChatwootActionType.startTyping:
27+
return "start_typing";
28+
case ChatwootActionType.stopTyping:
29+
return "stop_typing";
2630
}
2731
}
2832

@@ -32,6 +36,10 @@ ChatwootActionType actionTypeFromJson(String? value) {
3236
return ChatwootActionType.update_presence;
3337
case "subscribe":
3438
return ChatwootActionType.subscribe;
39+
case "start_typing":
40+
return ChatwootActionType.startTyping;
41+
case "stop_typing":
42+
return ChatwootActionType.stopTyping;
3543
default:
3644
return ChatwootActionType.update_presence;
3745
}

0 commit comments

Comments
 (0)