tween method
GTween
tween(
- Map targetMap, {
- 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 target Map to a specified targetMap
.
The tween will animate the values of the value map to the corresponding
values in the targetMap
. The parameters are the same as the ones in the
GTween.to method.
Throws an error if the targetMap
is empty or if there are no matching
keys with the tweenable target.
Implementation
GTween tween(
Map targetMap, {
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,
}) {
targetMap.removeWhere((k, v) => !value.containsKey(k));
if (targetMap.isEmpty) {
throw '''
tween(targetMap) Map can't be empty. Or there are no matching keys with the tweenable target.''';
}
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,
),
);
}