Last active
March 8, 2021 11:29
-
-
Save imgly-gists/b1cc6636d33b00a5a5ba2ace7fa698ea to your computer and use it in GitHub Desktop.
A minimal example showing how to use the configuration dart class.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:imgly_sdk/imgly_sdk.dart'; | |
| import 'package:photo_editor_sdk/photo_editor_sdk.dart'; | |
| /// Here, we assign custom stickers to the editor. | |
| /// | |
| /// We create a completely custom category | |
| /// containing custom stickers: | |
| /// A custom sticker displaying the Flutter logo: | |
| final flutterSticker = Sticker( | |
| "example_sticker_logos_flutter", "Flutter", "assets/Flutter-logo.png"); | |
| /// A custom sticker displaying the img.ly logo: | |
| final imglySticker = Sticker( | |
| "example_sticker_logos_imgly", "img.ly", "assets/imgly-Logo.png", | |
| tintMode: TintMode.solid); | |
| /// Assign the custom stickers to a new custom category: | |
| final logos = StickerCategory( | |
| "example_sticker_category_logos", "Logos", "assets/Flutter-logo.png", | |
| items: [flutterSticker, imglySticker]); | |
| /// Finally, add the custom category to your configuration: | |
| final configuration = Configuration( | |
| sticker: | |
| StickerOptions(personalStickers: true, categories: [logos])); | |
| /// Open the editor with customizations applied: | |
| PESDK.openEditor( | |
| image: "assets/demo-image.jpg", configuration: configuration); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment