evaluate<T> static method

T evaluate<T>(
  1. T value,
  2. Set<WidgetEvent> events
)

Resolves the value for the given set of events if value is a DrivenProperty, otherwise returns the value itself.

This is useful for widgets that have parameters which can optionally be a DrivenProperty.

Implementation

static T evaluate<T>(T value, Set<WidgetEvent> events) {
  if (value is DrivenProperty<T>) {
    final DrivenProperty<T> property = value;
    return property.resolve(events);
  }
  return value;
}