spritewidget library Null safety

A sprite toolkit built on top of Flutter.


A sequence of colors representing a gradient or a color transition over time. The sequence is represented by a list of colors and a list of stops, the stops are normalized values (0.0 to 1.0) and ordered in the list. Both lists have the same number of elements.
A constraint limits or otherwise controls a Node's properties, such as position or rotation. Add a list of constraints by setting the Node's constraints property.
A Constraint that constrains the position of a node to equal the position of another node, optionally with dampening.
A Constraint that aligns a nodes rotation to its movement.
A Constraint that rotates a node to point towards another node. The target node is allowed to have a different parent, but they must be in the same SpriteBox.
A Constraint that copies a node's rotation, optionally with dampening.
The EffectLine class is using the TexturedLine class to draw animated lines. These can be used to draw things such as smoke trails, electricity effects, or other animated types of lines.
Provides convenience methods for calculations often carried out in graphics. Some of the methods are returning approximations.
The ImageMap is a helper class for loading and keeping references to multiple images.
Labels are used to display a string of text in a the node tree. To align the label, the textAlign property of the TextStyle can be set.
A Node that provides an intermediate rendering surface in the sprite rendering tree. A Layer can be used to change the opacity, color, or to apply an effect to a set of nodes. All nodes that are children to the Layer will be rendered into the surface. If the area that is needed for the children to be drawn is know, the layerRect property should be set as this can enhance performance.
Motions are used to animate properties of nodes or any other type of objects. The motions are powered by an MotionController, typically associated with a Node. The most commonly used motion is the MotionTween which interpolates a property between two values over time.
A motion that calls a custom function when it is fired.
A class the controls the playback of motions. To play back an motion it is passed to the MotionController's run method. The MotionController itself is typically a property of a Node and powered by the SpriteBox.
A motion that doesn't perform any other task than taking time. This motion is typically used in a sequence to space out other events.
A motion that plays the supplied motions in parallell. The duration of the MotionGroup will be the maximum of the durations of the motions used to compose this motion.
A motion that doesn't have a duration. If this class is overridden to create custom instant motions, only the fire method should be overriden.
The abstract class for an motion that changes properties over a time interval, optionally using an easing curve.
A motion that removes the supplied node from its parent when it's fired.
An motion that repeats another motion a fixed number of times.
A motion that repeats a motion an indefinite number of times.
A motion that plays a number of supplied motions in sequence. The duration of the MotionSequence with be the sum of the durations of the motions passed in to the constructor.
The spline motion is used to animate a point along a spline definied by a set of points.
A motion that tweens a property between two values, optionally using an animation curve. This is one of the most common building blocks when creating motions. The tween class can be used to animate properties of the type Point, Size, Rect, double, or Color.
A NineSliceSprite is similar to a Sprite, but it it can strech its inner area to fit the size of the Node. This is ideal for fast drawing of things like buttons.
A base class for all objects that can be added to the sprite node tree and rendered to screen using SpriteBox and SpriteWidget.
An node that transforms its children using a 3D perspective projection. This node type can be used to create 3D flips and other similar effects.
The super class of any Node that has a size.
A particle system uses a large number of sprites to draw complex effects such as explosions, smoke, rain, or fire. There are a number of properties that can be set to control the look of the particle system. Most of the properties have a base value and a variance, these values are used when creating each individual particle. For instance, by setting the life to 1.0 and the lifeVar to 0.5, each particle will get a life time in the range of 0.5 to 1.5.
A Sprite is a Node that renders a bitmap image to the screen.
A RenderBox that draws a sprite world represented by a Node tree.
An event that is passed down the node tree when pointer events occur. The SpriteBoxEvent is typically handled in the handleEvent method of Node.
Defines properties, such as opacity and blendMode that are shared between Nodes that render textures to screen.
A sprite sheet packs a number of smaller images into a single large image.
A texture represents a rectangular area of an image and is typically used to draw a sprite to the screen.
A widget that uses a SpriteBox to render a sprite node tree to the screen.
A Node that draws a polyline from a list of points using the provided SpriteTexture. The textured line draws static lines. If you want to create an animated line, consider using the EffectLine instead.
Draws a polyline to a Canvas from a list of points using the provided SpriteTexture.
Provides a virtual joystick that can easily be added to your sprite scene.


convertDegrees2Radians(double degrees) double
Converts degrees to radians.
convertRadians2Degrees(double radians) double
Converts radians to degrees.
deserializeParticleSystem(Map data, {ParticleSystem? particleSystem, SpriteTexture? texture}) ParticleSystem
Creates a particle system from a json serialization.
randomBool() bool
Returns either true or false in a most random fashion.
randomDouble() double
Returns a random double in the range of 0.0 to 1.0.
randomInt(int max) int
Returns a random int from 0 to max - 1.
randomSignedDouble() double
Returns a random double in the range of -1.0 to 1.0.
serializeParticleSystem(ParticleSystem system) Map
Creates a json serialization of the settings for a particle system.


Used by EffectLine to determine how the texture of the line is animated.
Used by EffectLine to determine how the width of the line is calculated.
Defines types for pointer events.
Options for setting up a SpriteBox's coordinate system.


MotionCallback = void Function()
Signature for callbacks used by the MotionCallFunction.
PointSetterCallback = void Function(Offset value)
Signature for callbacks used by the MotionSpline to set a Point value.
SetterCallback<T> = void Function(T value)
Signature for callbacks for setting properties, used by MotionTween.