tween method
GTween
tween(
- List targetList, {
- 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,
Tweens the values in this list to the specified target values.
The targetList
argument should be a list of numeric values that has the
same length as the list of values in this instance of GTweenableList.
Returns a GTween instance that represents the tween animation.
Implementation
GTween tween(
List targetList, {
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,
}) {
targetList.removeWhere((element) => element is! num);
if (targetList.isEmpty) {
throw '''
tween(targetList) List can't be empty. Or values inside of it where not a number type''';
}
final targetMap = {};
for (var i = 0; i < targetList.length; ++i) {
targetMap[i] = targetList[i];
}
return GTween.to(
this,
duration,
targetMap,
GVars(
ease: ease,
delay: delay,
useFrames: useFrames,
overwrite: overwrite,
onStart: onStart,
onStartParams: onStartParams,
onComplete: onComplete,
onCompleteParams: onCompleteParams,
onUpdate: onUpdate,
onUpdateParams: onUpdateParams,
runBackwards: runBackwards,
immediateRender: immediateRender,
startAt: startAt,
));
}