alphaWithDuration method

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

执行透明度动画

范围为0-1

Implementation

Future<void> alphaWithDuration({
  Duration duration = const Duration(seconds: 1),
  double fromValue = 0,
  @required double toValue,
  int repeatCount = 0,
}) async {
  assert(fromValue >= 0 && fromValue <= 1);
  assert(toValue >= 0 && toValue <= 1);
  await kMethodChannel.invokeMethod('UIView::alphaWithDuration', {
    'refId': refId,
    'duration': duration.inMilliseconds / 1000,
    'fromValue': fromValue,
    'toValue': toValue,
    'repeatCount': repeatCount,
  });
}