canHandle method

  1. @override
bool canHandle(
  1. Message message,
  2. Map<String, List<Attachment>> attachments
)
override

Determines whether this builder can handle the given message and attachments. If this returns true, build will be called. Otherwise, the next builder in the list will be called.

Implementation

@override
bool canHandle(
  Message message,
  Map<String, List<Attachment>> attachments,
) {
  final files = attachments[AttachmentType.file];
  return files != null && files.isNotEmpty;
}