Created
January 10, 2022 18:39
-
-
Save sendbird-community/a22c69b7f7a3810238ec7b3ed96c1946 to your computer and use it in GitHub Desktop.
Chat Triggered Effects - Group Channel View Stacked View Wrapper
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
Widget sfxStackedBody( | |
BuildContext context, | |
SendbirdSFXController controller, | |
GroupChannel channel, | |
List<BaseMessage> messages, | |
) { | |
// Run all received messages through special effects check | |
controller.checkAndTriggerAll(channel, messages); | |
// Creating a list of widgets to feed into a Stack widget later | |
List<Widget> stackUIs = [ | |
for (SendbirdSFX sfx in controller.specialEffects) sfx.ui() | |
]; | |
// Add the original body | |
stackUIs.add(body(context)); | |
// A little breathing room for devices with no home button. | |
return SafeArea( | |
child: Stack( | |
children: stackUIs, | |
), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment