registerAttribute<T> method

void registerAttribute<T>(
  1. DraftModeFormAttribute<T> attribute
)

Implementation

void registerAttribute<T>(DraftModeFormAttribute<T> attribute) {
  final key = identityHashCode(attribute);
  _attributes[key] = attribute;
  _drafts.putIfAbsent(key, () => attribute.value);
  _committed.putIfAbsent(key, () => attribute.value);
  final definition = attribute.definition;
  if (definition != null) {
    _definitionAttributes.putIfAbsent(
      identityHashCode(definition),
      () => attribute,
    );
  }
}