Skip to content

Instantly share code, notes, and snippets.

@sendbird-community
Created January 10, 2022 18:39
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/a22c69b7f7a3810238ec7b3ed96c1946 to your computer and use it in GitHub Desktop.
Save sendbird-community/a22c69b7f7a3810238ec7b3ed96c1946 to your computer and use it in GitHub Desktop.
Chat Triggered Effects - Group Channel View Stacked View Wrapper
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