translateWithDuration method

Future<void> translateWithDuration(
  1. {Duration duration = const Duration(seconds: 1),
  2. @required CGPoint toValue,
  3. int repeatCount = 0,
  4. int repeatMode = 1}
)

执行移动动画

Implementation

Future<void> translateWithDuration({
  Duration duration = const Duration(seconds: 1),
  @required CGPoint toValue,
  int repeatCount = 0,
  int repeatMode = 1,
}) async {
  await kMethodChannel.invokeMethod('UIView::translateWithDuration', {
    '__this__': this,
    'duration': duration.inMilliseconds / 1000,
    'toX': await toValue.x,
    'toY': await toValue.y,
    'repeatCount': repeatCount,
    'repeatMode': repeatMode,
  });
}