flutter_sticker_picker 0.0.5
flutter_sticker_picker: ^0.0.5 copied to clipboard
A Flutter package for picking stickers with default sticker sets
README File for Dart, Flutter Sticker Picker Library
Description #
The Flutter Sticker Picker library is a simple and convenient tool for selecting stickers in Flutter applications. This library allows users to select stickers from a collection and use them in their apps.
Installation #
To use this library, add the following line to your project's pubspec.yaml file:
dependencies:
flutter_sticker_picker: ^1.0.0
Then run the command flutter pub get in your terminal to load the dependencies.
Usage #
To use the library, import it in your Dart file:
import 'package:flutter_sticker_picker/flutter_sticker_picker.dart';
Then create an instance of the StickerPickerView class and pass it a collection of stickers:
StickerPickerView(
categories: [
LoveStickersCategory()
],
onStickerSelected: (stickerSelected) {
debugPrint(
"sticker selected $stickerSelected",
);
},
),
Parameters #
categories: a collection of stickers categories to be displayed in the picker.onStickerSelected: a function that will be called when a user selects a sticker.
Example #
import 'package:flutter/material.dart';
import 'package:flutter_sticker_picker/flutter_sticker_picker.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: StickerPicker(
categories: [
LoveStickersCategory()
],
onStickerSelected: (sticker) {
print('Sticker selected: ${sticker.name}');
},
),
),
),
);
}
}
License #
This library is distributed under the MIT License. You can use, modify, and distribute it freely.
Contributing #
Contributions are welcome! If you have any ideas or bug fixes, please submit a pull request.
Changelog #
- 1.0.0: Initial release.