Search categories, packages and repositories

Package detailsv1.0.1+5

flutter_whatsapp_stickers

Flutter plugin for adding WhatsApp Stickers within your flutter app.

Android
30-day downloads
8
Likes
61
Pub points
145

Install package

flutter pub add flutter_whatsapp_stickers

Package Overview

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

A Flutter plugin that enables integration of WhatsApp stickers directly within a Flutter application. It allows users to create, manage, and share custom stickers through WhatsApp, enhancing chat experiences with expressive visuals. The plugin is designed specifically for Android and provides a straightforward API to handle sticker packs and their metadata. It supports the WhatsApp sticker format requirements, making it easy to package and distribute stickers from within a Flutter app.

Use cases

  • Sharing custom stickers in WhatsApp chats
  • Integrating sticker packs into messaging apps
  • Enabling user-generated sticker content
  • Adding interactive sticker features to apps
  • Creating branded sticker collections

Key features

  • Android-only support
  • Simple API for sticker pack management
  • Supports WhatsApp sticker format
  • Easy integration with Flutter apps
  • Handles metadata and image assets

Suitable for

  • Developers building messaging apps
  • Apps focused on user-generated content
  • Branded sticker distribution platforms
  • Creative tools for sticker design
  • Android-first Flutter applications

Considerations

  • Limited to Android platform
  • Requires adherence to WhatsApp sticker specifications
  • No iOS support
  • Sticker pack must be properly formatted
  • May require additional asset handling

Original README

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

WhatsApp Stickers plugin for Flutter

pub package

This plugin is still under development and for now, only Android is supported. Feedback and Pull Requests are welcome!

I'm in the process of rebuilding this plugin and the new version will be released at the end of October 🤞

Getting Started

Add flutter_whatsapp_stickers as a dependency in your pubspec.yaml file.

Check out the example directory for a sample app.

Android Configuration

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

android {
    aaptOptions {
        noCompress "webp"
    }
}
Packaged Assess

You need to include your assets in your pubspec.yaml file.

flutter:
  assets:
    - sticker_packs/sticker_packs.json
    - sticker_packs/1/
Dynamic Content

If you are using assets that are not bundled in your build, then you need to add the following to your Manifest file. Note that you cannot use both.

<meta-data android:name="NonAssetContentProvider" android:value="true" />
Sticker Pack Contents File

To change the stickers packs file, add this Build Config Field to your app\build.gradle file. The default is sticker_packs.json.

buildConfigField("String", "STICKER_PACK_FILE", "\"sticker_packs.json\"")

iOS Integration

Currently, there is no iOS support. Pull requests for this are more than welcome for this.

Methods

Check if WhatsApp is installed.

bool whatsAppInstalled = await WhatsAppStickers.isWhatsAppInstalled;

Check if the WhatsApp Consumer package is installed

bool whatsAppConsumerAppInstalled = await WhatsAppStickers.isWhatsAppConsumerAppInstalled;

Check if the WhatsApp Business package app is installed

bool whatsAppSmbAppInstalled = await WhatsAppStickers.isWhatsAppSmbAppInstalled;

Check if a sticker pack is installed.

_stickerPackInstalled = await WhatsAppStickers().isStickerPackInstalled(_stickerPackIdentifier);

Add a sticker pack to WhatsApp.

WhatsAppStickers().addStickerPack(
  packageName: WhatsAppPackage.Consumer,
  stickerPackIdentifier: _stickerPackIdentifier,
  stickerPackName: _stickerPackName,
  listener: _listener,
);

Updated Sticker Pack contents and notify listeners

WhatsAppStickers().updatedStickerPacks(_stickerPackIdentifier);

The Add Sticker Pack Listener

Future<void> _listener(StickerPackResult action, bool result, {String error}) async {
    // Do what you must here
}

Here is an example of how to create a custom stickers_packs.json file.

void createLocalFile() async {
  String dir = (await getApplicationDocumentsDirectory()).path;
  Directory stickersDirectory = Directory("$dir/sticker_packs");
  if (!await stickersDirectory.exists()) {
    await stickersDirectory.create();
  }

  File jsonFile = File('$dir/sticker_packs/sticker_packs.json');
  String content = jsonEncode(stickerPacks);
  jsonFile.writeAsStringSync(content);
}

Categories

Dependencies

Dependency list 2 items

Source repository

Projects using this package

No data available yet.