Skip to content

Instantly share code, notes, and snippets.

@sendbird-community
Created January 10, 2022 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sendbird-community/50c1d6d0b685afccd71eef9f23261fa5 to your computer and use it in GitHub Desktop.
Save sendbird-community/50c1d6d0b685afccd71eef9f23261fa5 to your computer and use it in GitHub Desktop.
Chat Triggered Effects - SendbirdSFXController main functions
class SendbirdSFXController {
SendbirdSFXController(this.specialEffects);
List<SendbirdSFX> specialEffects;
Future<void> checkAndTriggerAll(
BaseChannel channel,
List<BaseMessage> messages,
) async {
for (BaseMessage message in messages) {
await checkAndTrigger(channel, message);
}
return;
}
Future<void> checkAndTrigger(
BaseChannel channel,
BaseMessage message,
) async {
for (SendbirdSFX sfx in specialEffects) {
await sfx.checkAndTrigger(channel, message);
}
return;
}
Future<void> dispose() async {
for (SendbirdSFX sfx in specialEffects) {
sfx.dispose();
}
return;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment