FLUTTER ECOSYSTEM

slimpotatoboy/slack_logger

슬랙 웹훅을 통해 슬랙 채널로 메시지를 보내는 간단한 플러터 패키지

slack_logger 프로젝트 이미지
Stars
8
Forks
3
최근 푸시(UTC)
2024. 9. 26.
프로젝트 상태
활성
Dipen GitHub avatar
GITHUB User

Dipen ↗

Developer

Australia
언어Dart

기술 주제

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 4 개
  • flutter{"sdk":"flutter"}
  • http^1.1.0
  • flutter_test개발 의존성{"sdk":"flutter"}
  • flutter_lints개발 의존성>=2.0.0 <5.0.0

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기

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(
      ...
    );
  }
}
Create Instance of SlackLogger
final slack = SlackLogger.instance;
Send Message:
...

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

...
Send Image:
...

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

...
Send Image With Text Block:
...

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

...
Send Text (Markdown) with Button:
...

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

...
Send Text As Attachments:
...

slack.sendTextAsAttachment(
  message:"[Your Message]",
  color: "[color]"
);

...
Send Markdowns As Attachments:
...

slack.sendMarkdownAsAttachment(
  markdownMessageList: List<String> [markdownMessageList],
  color: "[color]"
);

...

🚀 Contributors


Any new Contributors are welcomed.

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