build method
Widget
build(
- BuildContext context,
- Message message,
- Map<
String, List< attachmentsAttachment> >
override
Builds a widget for the given message
and attachments
.
This will only be called if canHandle returns true
.
Implementation
@override
Widget build(
BuildContext context,
Message message,
Map<String, List<Attachment>> attachments,
) {
assert(debugAssertCanHandle(message, attachments), '');
final giphy = attachments[AttachmentType.giphy]!.first;
VoidCallback? onTap;
if (onAttachmentTap != null) {
onTap = () => onAttachmentTap!(message, giphy);
}
return Padding(
padding: padding,
child: InkWell(
onTap: onTap,
child: StreamGiphyAttachment(
message: message,
constraints: constraints,
giphy: giphy,
shape: shape,
),
),
);
}