Skip to content

A simple dart package to send message to slack channel via slack webhook

License

Notifications You must be signed in to change notification settings

ayyshim/slack_logger

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Slack Logger 🚀

GitHub stars

Follow Twitter

A simple Flutter package to send message to slack channel via slack webhook

Usage

To use this plugin, add slack_logger as a dependency in your pubspec.yaml file 🔗.

Steps before using this package

  • Add Apps to 🔗 https://api.slack.com/apps/.

  • Go to Incoming Webhook Link and Enable it.

  • Create your slack channel.

  • Create new webhook and link slack channel.

You are good to go now 👍

Initialize [SlackLogger]

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {

    SlackLogger(webhookUrl: "[Add Your Web Hook Url]");

    return MaterialApp(
      ...
    );
  }
}

Send Message:

final slack = SlackLogger.instance;

...

slack.send("This is a error log to my channel");

...

Send Image:

final slack = SlackLogger.instance;

...

slack.sendImage(
  imageUrl: "[image url]",
  imageAltText: "[alt text for image]",
);

...

Send Image With Text Block:

final slack = SlackLogger.instance;

...

slack.sendImageWithText(
  text: "[text]",
  imageUrl: "[image url]",
  imageAltText: "[alt text for image]"
);

...

Send Text (Markdown) with Button:

final slack = SlackLogger.instance;

...

slack.sendTextWithButton(
  markdownMessage: "[markdown message]",
  buttonLabel: "[button label]",
  url: "[button link]"
);

...

🚀 Contributors


Any new Contributors are welcomed.

Feel Free to request any missing features or report issues here 🔗.

About

A simple dart package to send message to slack channel via slack webhook

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 100.0%