maybeChange<T> static method

bool maybeChange<T>(
  1. BuildContext context,
  2. Symbol key,
  3. T data
)

Optionally find the property of the given type from the context. Returns null if the data is not found.

  • T The type of the data.
  • context The build context.
  • key The data key.

Implementation

static bool maybeChange<T>(BuildContext context, Symbol key, T data) {
  final property = maybeFindProperty<T>(context, key);
  if (property == null) {
    return false;
  }
  property.value = data;
  return true;
}