attributeOr<T> method

T attributeOr<T>(
  1. String key,
  2. T defaultValue
)

Gets attribute with default.

Implementation

T attributeOr<T>(String key, T defaultValue) {
  final value = _attributes[key];
  return value is T ? value : defaultValue;
}