SlackBot class

This can be used to send messages to a Slack incoming webhook.

First you need to create a _Message object using composeMsg. You can use the return instance to generate a custom message.

final url = 'https://hooks.slack.com/services/XXX/XXX/XXX';
final msg = SlackBot.composeMsg(url)
  ..addHeader("This is header")
  ..addTextSection("This is body");

Then you can build it and and send it.

final sent = await msg.build().send();

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send() Future<bool>
Use this method to send a message to the slack incoming webhook url that was given by composeMsg method. Instance of SlackBot can be created using the _Message.build method. You can create _Message instances using composeMsg method.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

composeMsg(String url) → _Message
Create a _Message instance that can be used to compose a custom message.