StickIt class
StickIt creates a Stack view, consisting of
- the child provided as Widget
- a List of Images called stickerList.
The default behavior will allow the Images to be added, scaled, rotated and deleted. Sticker can be scaled within a customizable scale.
Calling the exportImage function will provide an Uint8List, that can be used to preview or further save the image + sticker composition.
See also:
- github.com/myriky/flutter_simple_sticker_view, which is the original project.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- StickIt
Constructors
-
StickIt({Key? key, required Widget child, required List<
Image> stickerList, double devicePixelRatio = 3.0, double panelHeight = 200.0, Color panelBackgroundColor = Colors.black, Color panelStickerBackgroundColor = Colors.white10, int panelStickerCrossAxisCount = 4, double panelStickerAspectRatio = 1.0, bool stickerRotatable = true, double stickerSize = 100.0, double stickerMaxScale = 2.0, double stickerMinScale = 0.5, Size viewport = const Size(0.0, 0.0)})
Properties
- child → Widget
-
Content you wish to place stickers upon.
final
- devicePixelRatio → double
-
The devices pixel ratio.
See also: stackoverflow.com/questions/8785643/what-exactly-is-device-pixel-ratio
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- panelBackgroundColor → Color
-
Background color of the bottom panel.
final
- panelHeight → double
-
Height of the bottom panel.
final
- panelStickerAspectRatio → double
-
Ratio of the cross-axis to the main-axis extent of each child.
final
- panelStickerBackgroundColor → Color
-
Background color of the container stickers are placed within.
final
- panelStickerCrossAxisCount → int
-
Defines how many stickers are placed within one row of the grid.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stickerList
→ List<
Image> -
List of sticker images that should be shown within the bottom panel.
Those can be placed on top of your child Widget.
final
- stickerMaxScale → double
-
Maximal scaling ratio for your stickers.
E.g 2 will allow the sticker to be twice as big!
final
- stickerMinScale → double
-
Minimal scaling ratio for your stickers.
E.g 0.5 will allow the sticker to be half as big at minimum!
final
- stickerRotatable → bool
-
Controls whether your stickers should be rotatable, while the scaling event is active.
Set to false, if you don't want rotation.
final
- stickerSize → double
-
Size of the Rect the stickers are on when placed within the Stack.
final
- viewport → Size
-
Size of the viewport that is provided.
You don't have to set this manually, it will take the available space per default.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _StickItState -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of
DiagnosticsNode
objects describing this node's children.inherited -
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
exportImage(
) → Future< Uint8List> -
Creates an
Uint8List
out of your composition, that you can use to save as Image. Before that it will clear all selections, so they don't appear on the new creation. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited