Created
January 10, 2022 18:35
-
-
Save sendbird-community/50c1d6d0b685afccd71eef9f23261fa5 to your computer and use it in GitHub Desktop.
Chat Triggered Effects - SendbirdSFXController main functions
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
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