slack_notifier 1.0.0

  • Readme
  • Changelog
  • Example
  • Installing
  • new66

slack_notifier #

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

Build Status pub package

Usage #

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.

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<Attachment> attachments, // Attachment list that can be added as secondary content.

Result #

The message will look like this:


1.0.0 #

  • Publish stable version.

0.0.1 #

  • Initial release.


import 'package:slack_notifier/slack_notifier.dart';

void main() {
  final slack = SlackNotifier('T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX');
  slack.send('Hello world :tada:', channel: 'general');

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  slack_notifier: ^1.0.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:slack_notifier/slack_notifier.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jul 6, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
http ^0.12.1 0.12.1
Transitive dependencies
charcode 1.1.3
collection 1.14.13
http_parser 3.1.4
meta 1.2.1
path 1.7.0
pedantic 1.9.1
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.2.0
Dev dependencies
test ^1.14.7