flutter_sticker_maker 0.1.0
flutter_sticker_maker: ^0.1.0 copied to clipboard
Flutter plugin to create stickers from images using iOS Vision/CoreImage and Android MLKit.
Flutter Sticker Maker #
A cross-platform Flutter plugin to create stickers by removing backgrounds from images using iOS Vision/CoreImage and Android MLKit.
Features #
- iOS: Uses Vision and CoreImage for background removal.
- Android: Uses Google ML Kit Selfie Segmentation.
- Handles storage, gallery, and camera permissions automatically.
- Configurable border support with customizable color and width.
- Simple Dart API.
Usage #
import 'package:flutter_sticker_maker/flutter_sticker_maker.dart';
// Basic usage
final sticker = await FlutterStickerMaker.makeSticker(imageBytes);
// With border customization
final stickerWithBorder = await FlutterStickerMaker.makeSticker(
imageBytes,
addBorder: true,
borderColor: '#FF0000', // Red border
borderWidth: 15.0, // 15 pixel border width
);
Parameters #
imageBytes: The input image as Uint8List (PNG/JPEG)addBorder: Whether to add a border around the sticker (default: true)borderColor: Hex color string for the border (default: '#FFFFFF')borderWidth: Width of the border in pixels (default: 12.0)
See example/ for a full demo app.
Setup #
- iOS: Minimum iOS 17.0
- Android: Minimum SDK 21
Permissions #
Add to AndroidManifest.xml:
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28"/>
<uses-permission android:name="android.permission.CAMERA" />
Add to ios/Runner/Info.plist:
<key>NSPhotoLibraryUsageDescription</key>
<string>This app needs access to your photo library to pick images and save stickers.</string>
<key>NSCameraUsageDescription</key>
<string>This app needs camera access to take pictures for sticker creation.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>This app saves stickers to your photo library.</string>