-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: edit the event handler code
- Loading branch information
1 parent
fd5eab4
commit d1637ba
Showing
6 changed files
with
66 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import 'package:waterbus_sdk/types/models/callback_payload.dart'; | ||
import 'package:waterbus_sdk/types/models/conversation_socket_event.dart'; | ||
import 'package:waterbus_sdk/types/models/draw_model.dart'; | ||
import 'package:waterbus_sdk/types/models/message_socket_event.dart'; | ||
import 'package:waterbus_sdk/types/models/stats.dart'; | ||
import 'package:waterbus_sdk/types/models/subtitle.dart'; | ||
|
||
class WaterBusEventListener { | ||
final Function(CallbackPayload)? onEventChanged; | ||
final Function(VideoSenderStats)? onStatsChanged; | ||
final Function(Subtitle)? onSubtitle; | ||
final Function(MessageSocketEvent)? onMesssageChanged; | ||
final Function(ConversationSocketEvent)? onConversationChanged; | ||
final Function(List<DrawModel> drawList)? onDrawChanged; | ||
|
||
WaterBusEventListener({ | ||
this.onEventChanged, | ||
this.onStatsChanged, | ||
this.onSubtitle, | ||
this.onMesssageChanged, | ||
this.onConversationChanged, | ||
this.onDrawChanged, | ||
}); | ||
|
||
WaterBusEventListener copyWith({ | ||
Function(CallbackPayload)? onEventChanged, | ||
Function(VideoSenderStats)? onStatsChanged, | ||
Function(Subtitle)? onSubtitle, | ||
Function(MessageSocketEvent)? onMesssageChanged, | ||
Function(ConversationSocketEvent)? onConversationChanged, | ||
Function(List<DrawModel> drawList)? onDrawChanged, | ||
}) { | ||
return WaterBusEventListener( | ||
onEventChanged: onEventChanged ?? this.onEventChanged, | ||
onStatsChanged: onStatsChanged ?? this.onStatsChanged, | ||
onSubtitle: onSubtitle ?? this.onSubtitle, | ||
onMesssageChanged: onMesssageChanged ?? this.onMesssageChanged, | ||
onConversationChanged: | ||
onConversationChanged ?? this.onConversationChanged, | ||
onDrawChanged: onDrawChanged ?? this.onDrawChanged, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters