A simple wrapper to post messages from external sources into Slack.

Build Status pub package


To use this package, your workspace needs to have a Webhook URL. If you don't have it, follow the instructions here.

The SlackNotifier class has only one method, with optional parameters to customize your messages. It supports block kit.

Future<String> send(
  String text, {
  String? channel,   // Channel, private group, or IM channel name to send message to.
  String? iconEmoji, // Emoji to use as the icon for this message.
  String? iconUrl,   // URL to an image to use as the icon for this message.
  String? username,  // Set your bot's user name.
  List<Block>? blocks, // Blocks that can be combined to create interactive messages.
  List<Attachment>? attachments, // Attachments that can be added as secondary content.

And the message will look like this: