Search packages, repositories and app categories

Package detailsv0.0.4

whatsapp_stickers

WhatsApp Stickers plugin for Flutter.

30-day downloads
18
Likes
25
Pub points
30

Install package

flutter pub add whatsapp_stickers

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The whatsapp_stickers package enables Flutter applications to integrate WhatsApp sticker functionality, allowing users to create, manage, and share custom stickers directly within WhatsApp. It provides a straightforward API to handle sticker packs, including adding stickers with associated metadata like emojis and names. Designed for developers aiming to enhance chat experiences with interactive stickers, the plugin simplifies the process of packaging and distributing stickers from Flutter apps. The package is particularly useful for messaging or creative apps targeting WhatsApp users.

Use cases

  • Sharing custom stickers in WhatsApp chats
  • Creating sticker packs from app content
  • Integrating sticker sharing in messaging apps
  • Enabling user-generated sticker creation
  • Enhancing social app engagement with stickers

Key features

  • Easy sticker pack creation
  • Support for emoji and metadata tagging
  • Simple integration with WhatsApp
  • Cross-platform compatibility (future)
  • API for managing sticker assets

Suitable for

  • Flutter developers building messaging apps
  • Apps focused on user-generated content
  • Creative tools for sticker design
  • Social platforms seeking WhatsApp integration
  • Developers targeting WhatsApp-native features

Considerations

  • Requires WhatsApp to be installed on device
  • Limited to WhatsApp's sticker format standards
  • No official support for all platforms yet
  • Sticker pack distribution depends on WhatsApp's policies
  • Testing may require physical devices due to platform restrictions

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

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);
  }
}

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package

No data available yet.