groupWithDuration method
执行组合动画
keyPath
为构造CABasicAnimation时的CABasicAnimation animationWithKeyPath:keyPath
;
缩放为transform.scale
, 透明度为opacity
, 旋转为transform.rotation
fromValue
, toValue
和keyPath
的长度必须相等
Implementation
Future<void> groupWithDuration({
Duration duration = const Duration(seconds: 1),
required List<double> fromValue,
required List<double> toValue,
required List<String> keyPath,
int repeatCount = 0,
int repeatMode = 0,
}) async {
assert(fromValue.length == toValue.length);
assert(toValue.length == keyPath.length);
await kMethodChannel.invokeMethod('UIView::groupWithDuration', {
'__this__': this,
'duration': duration.inMilliseconds / 1000,
'fromValue': [for (final item in fromValue) item / 180 * pi],
'toValue': [for (final item in fromValue) -item / 180 * pi],
'keyPath': keyPath,
'repeatCount': repeatCount,
'repeatMode': repeatMode,
});
}