getOrElse<T> method

T getOrElse<T>(
  1. P property,
  2. T defaultValue
)

Returns the animated value for a specified property regarding the current position (in time) of the animation, similar to get.

If the property is not defined inside the MultiTween it will return the specified defaultValue.

Implementation

T getOrElse<T>(P property, T defaultValue) {
  // ignore: omit_local_variable_types
  T? value =
      _tracks.containsKey(property) ? _computeValue(property) : defaultValue;

  if (value == null) {
    return defaultValue;
  }

  return value;
}