GTweenableColor class
/ --------------------------------------------------------------------------- A class that wraps a Color object and makes it animatable with GTween.
To use this class, create an instance with a Color object and call the
tween()
method to create a GTween animation.
- Mixed in types
Constructors
- GTweenableColor(Color target)
-
Creates a new instance of GTweenableColor with the given
target
value.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- target ↔ Object?
-
The actual target object where we should get the accessors from. If a
"wrapper" is registered under the same Type as target, GTween will use
it internally to create a GTweenable. Also used by GTween to reference
internally the "_nativeTarget" instead of the GTweenable instance. So
you can "kill" the tween by GTweenable or using the actual object that
you plan to Tween.
getter/setter pairinherited
- value ↔ Color?
-
This property holds the current Color value being tweened by GTween.
getter/setter pair
Methods
-
dispose(
) → void -
Called when the tween is disposed.
inherited
-
getProperty(
Object property) → double -
Overrides the method in GTweenable.
It returns the start value of the property being tweened, from 0-1.
override
-
getTweenableAccessors(
) → Map< String, List< ?Function> > -
(Internal)
Implemented in sub classes.
inherited
-
initProps(
) → void -
This method initializes the
_accessors
map with the object's properties and their corresponding getter and setter functions. The getTweenableAccessors method should be implemented in the target object class and should return a map of property names and their corresponding getter and setter functions. If no such map is returned, the _accessors map remains null.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setProperty(
Object? property, double targetValue) → void -
Sets the current value property of GTweenableColor by lerping between
the target Color and _targetColor using the given
targetValue
.override -
setTweenProp(
PropTween tweenProp) → void -
Sets the property tween object _propTween used by GTween, and sets the
target value to 1.
override
-
toString(
) → String -
Returns a string representation of this GTweenable object.
inherited
-
tween(
Color color, {required double duration, EaseFunction? ease, double? delay, bool? useFrames, int? overwrite, VoidCallback? onStart, Object? onStartParams, VoidCallback? onComplete, Object? onCompleteParams, VoidCallback? onUpdate, Object? onUpdateParams, bool? runBackwards, bool? immediateRender, Map? startAt}) → GTween - Creates a GTween animation for this object.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
String key) → double? -
Overridden operator that allows to "get" the property value of a specific
key without calling the getProperty method.
inherited
-
operator []=(
String key, double value) → void -
Overridden operator that allows to "set" the property value of a specific
key without calling the setProperty method.
inherited
Static Methods
-
wrap(
Object target) → GTweenable? -
Wraps the given object
target
as a GTweenableColor if it is a Color, otherwise returnsnull
.