搜尋套件、儲存庫與 APP 分類

套件詳情v0.0.4

whatsapp_stickers

適用於 Flutter 的 WhatsApp 貼紙外掛程式。

近 30 天下載
18
喜歡數
25
Pub 分數
30

安裝套件

flutter pub add whatsapp_stickers

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

whatsapp_stickers 套件讓 Flutter 應用程式能夠整合 WhatsApp 貼紙功能,讓使用者可以直接在 WhatsApp 中建立、管理並分享自訂貼紙。它提供一個簡單的 API 來處理貼紙套組,包含加入帶有相關元資料(如表情符號和名稱)的貼紙。此外,該套件專為希望透過互動式貼紙提升聊天體驗的開發者設計,簡化從 Flutter 應用程式打包與分發貼紙的流程。對於針對 WhatsApp 用戶的訊息或創意類應用而言,此套件特別實用。

適用情境

  • 在 WhatsApp 聊天中分享自定表情符號
  • 從應用內容建立貼紙套件
  • 在即時通訊應用中整合貼紙分享
  • 啟用使用者產生貼紙創建
  • 透過貼紙增強社交應用的參與度

主要特色

  • 輕鬆建立貼紙套件
  • 支援表情符號和元數據標記
  • 與 WhatsApp 的簡單整合
  • 跨平台相容性(未來)
  • 用於管理貼紙資源的 API

適合對象

  • Flutter 開發人員建構即時通訊應用
  • 專注於使用者產生內容的應用程式
  • 貼紙設計的創意工具
  • 尋求 WhatsApp 結合的社交平台
  • 針對 WhatsApp 原生功能的開發者

使用建議

  • 需要在設備上安裝 WhatsApp
  • 受限於 WhatsApp 的貼紙格式標準
  • 尚未提供所有平台的官方支援
  • 貼紙包的分發取決於WhatsApp的政策
  • 由於平台限制,測試可能需要實體設備

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

whatsapp_stickers

A Flutter plugin for adding stickers to WhatsApp.

Notes

  • trayImageFileName uses PNG data whereas stickers use WebP data.

Usage

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

Android

Add the following option to your app\build.gradle file. This will prevent all WebP files from being compressed.

android {
    aaptOptions {
        noCompress "webp"
    }
}
iOS

Do not forget to add following entry to Info.plist with Runner target.

<key>LSApplicationQueriesSchemes</key>
	<array>
		<string>whatsapp</string>
	</array>

Examples

Local assets

Put your stickers in any folder, for example, assets. Do not forget to add this folder to pubspec.yaml.

const stickers = {
  '01_Cuppy_smile.webp': ['☕', '🙂'],
  '02_Cuppy_lol.webp': ['😄', '😀'],
  '03_Cuppy_rofl.webp': ['😆', '😂'],
  '04_Cuppy_sad.webp': ['😃', '😍'],
  '05_Cuppy_cry.webp': ['😭', '💧'],
  '06_Cuppy_love.webp': ['😍', '♥'],
  '07_Cuppy_hate.webp': ['💔', '👎'],
  '08_Cuppy_lovewithmug.webp': ['😍', '💑'],
  '09_Cuppy_lovewithcookie.webp': ['😘', '🍪'],
  '10_Cuppy_hmm.webp': ['🤔', '😐'],
  '11_Cuppy_upset.webp': ['😱', '😵'],
  '12_Cuppy_angry.webp': ['😡', '😠'],
  '13_Cuppy_curious.webp': ['❓', '🤔'],
  '14_Cuppy_weird.webp': ['🌈', '😜'],
  '15_Cuppy_bluescreen.webp': ['💻', '😩'],
  '16_Cuppy_angry.webp': ['😡', '😤'],
  '17_Cuppy_tired.webp': ['😩', '😨'],
  '18_Cuppy_workhard.webp': ['😔', '😨'],
  '19_Cuppy_shine.webp': ['🎉', '✨'],
  '20_Cuppy_disgusting.webp': ['🤮', '👎'],
  '21_Cuppy_hi.webp': ['🖐', '🙋'],
  '22_Cuppy_bye.webp': ['🖐', '👋'],
};

Future installFromAssets() async {
  var stickerPack = WhatsappStickers(
    identifier: 'cuppyFlutterWhatsAppStickers',
    name: 'Cuppy Flutter WhatsApp Stickers',
    publisher: 'John Doe',
    trayImageFileName: WhatsappStickerImage.fromAsset('assets/tray_Cuppy.png'),
    publisherWebsite: '',
    privacyPolicyWebsite: '',
    licenseAgreementWebsite: '',
  );

  stickers.forEach((sticker, emojis) {
    stickerPack.addSticker(WhatsappStickerImage.fromAsset('assets/$sticker'), emojis);
  });

  try {
    await stickerPack.sendToWhatsApp();
  } on WhatsappStickersException catch (e) {
    print(e.cause);
  }
}

Remote assets
const stickers = {
  '01_Cuppy_smile.webp': ['☕', '🙂'],
  '02_Cuppy_lol.webp': ['😄', '😀'],
  '03_Cuppy_rofl.webp': ['😆', '😂'],
  '04_Cuppy_sad.webp': ['😃', '😍'],
  '05_Cuppy_cry.webp': ['😭', '💧'],
  '06_Cuppy_love.webp': ['😍', '♥'],
  '07_Cuppy_hate.webp': ['💔', '👎'],
  '08_Cuppy_lovewithmug.webp': ['😍', '💑'],
  '09_Cuppy_lovewithcookie.webp': ['😘', '🍪'],
  '10_Cuppy_hmm.webp': ['🤔', '😐'],
  '11_Cuppy_upset.webp': ['😱', '😵'],
  '12_Cuppy_angry.webp': ['😡', '😠'],
  '13_Cuppy_curious.webp': ['❓', '🤔'],
  '14_Cuppy_weird.webp': ['🌈', '😜'],
  '15_Cuppy_bluescreen.webp': ['💻', '😩'],
  '16_Cuppy_angry.webp': ['😡', '😤'],
  '17_Cuppy_tired.webp': ['😩', '😨'],
  '18_Cuppy_workhard.webp': ['😔', '😨'],
  '19_Cuppy_shine.webp': ['🎉', '✨'],
  '20_Cuppy_disgusting.webp': ['🤮', '👎'],
  '21_Cuppy_hi.webp': ['🖐', '🙋'],
  '22_Cuppy_bye.webp': ['🖐', '👋'],
};

Future installFromRemote() async {
  var applicationDocumentsDirectory = await getApplicationDocumentsDirectory();
  var stickersDirectory = Directory('${applicationDocumentsDirectory.path}/stickers');
  await stickersDirectory.create(recursive: true);

  final dio = Dio();
  final downloads = <Future>[];

  stickers.forEach((sticker, emojis) {
    downloads.add(
      dio.download(
        'https://github.com/applicazza/whatsapp_stickers/raw/master/example/assets/$sticker',
        '${stickersDirectory.path}/$sticker',
      ),
    );
  });

  await Future.wait(downloads);

  var stickerPack = WhatsappStickers(
    identifier: 'cuppyFlutterWhatsAppStickers',
    name: 'Cuppy Flutter WhatsApp Stickers',
    publisher: 'John Doe',
    trayImageFileName: WhatsappStickerImage.fromAsset('assets/tray_Cuppy.png'),
    publisherWebsite: '',
    privacyPolicyWebsite: '',
    licenseAgreementWebsite: '',
  );

  stickers.forEach((sticker, emojis) {
    stickerPack.addSticker(WhatsappStickerImage.fromFile('${stickersDirectory.path}/$sticker'), emojis);
  });

  try {
    await stickerPack.sendToWhatsApp();
  } on WhatsappStickersException catch (e) {
    print(e.cause);
  }
}

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。