-
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Sticker Editor for Enhanced Widget Integration
- Introduce Sticker Editor functionality for loading stickers and widgets in the editor. - Update documentation in CHANGELOG.md and README.md. - Add new assets and models for sticker editor configurations. - Refactor existing models and modules to support sticker editor integration. - Update tests and pubspec.yaml to reflect changes.
- Loading branch information
Showing
22 changed files
with
784 additions
and
322 deletions.
There are no files selected for viewing
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import 'package:flutter/widgets.dart'; | ||
|
||
/// Configuration options for a sticker editor. | ||
/// | ||
/// `StickerEditorConfigs` allows you to define various settings for a sticker | ||
/// editor. You can configure features like enabling/disabling the editor, | ||
/// initial sticker width, and a custom method to build stickers. | ||
/// | ||
/// Example usage: | ||
/// ```dart | ||
/// StickerEditorConfigs( | ||
/// enabled: false, | ||
/// initWidth: 150, | ||
/// buildStickers: (setLayer) { | ||
/// return Container(); // Replace with your builder to load and display stickers. | ||
/// }, | ||
/// ); | ||
/// ``` | ||
class StickerEditorConfigs { | ||
/// Indicates whether the sticker editor is enabled. | ||
/// | ||
/// When set to `true`, the sticker editor is active and users can interact with it. | ||
/// If `false`, the editor is disabled and does not respond to user inputs. | ||
final bool enabled; | ||
|
||
/// The initial width of the stickers in the editor. | ||
/// | ||
/// Specifies the starting width of the stickers when they are first placed | ||
/// in the editor. This value is in logical pixels. | ||
final double initWidth; | ||
|
||
/// A callback that builds the stickers. | ||
/// | ||
/// This typedef is a function that takes a function as a parameter and | ||
/// returns a Widget. The function parameter `setLayer` is used to set a | ||
/// layer in the editor. This callback allows for customizing the appearance | ||
/// and behavior of stickers in the editor. | ||
final BuildStickers buildStickers; | ||
|
||
/// Creates an instance of StickerEditorConfigs with optional settings. | ||
/// | ||
/// By default, the editor is disabled (if not specified), and other properties | ||
/// are set to reasonable defaults. | ||
const StickerEditorConfigs({ | ||
required this.buildStickers, | ||
this.initWidth = 100, | ||
this.enabled = false, | ||
}); | ||
} | ||
|
||
typedef BuildStickers = Widget Function(Function(Widget) setLayer); |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/// Internationalization (i18n) settings for the I18nStickerEditor Editor component. | ||
class I18nStickerEditor { | ||
/// Text for the bottom navigation bar item that opens the I18nStickerEditor Editor. | ||
final String bottomNavigationBarText; | ||
|
||
/// Creates an instance of [I18nStickerEditor] with customizable internationalization settings. | ||
/// | ||
/// You can provide translations and messages specifically for the I18nStickerEditor Editor | ||
/// component of your application. | ||
/// | ||
/// Example: | ||
/// | ||
/// ```dart | ||
/// I18nStickerEditor( | ||
/// bottomNavigationBarText: 'I18nStickerEditor', | ||
/// ) | ||
/// ``` | ||
const I18nStickerEditor({ | ||
this.bottomNavigationBarText = 'Stickers', | ||
}); | ||
} |
Oops, something went wrong.