defineElement function

void defineElement(
  1. String name,
  2. ElementCreator creator
)

Implementation

void defineElement(String name, ElementCreator creator) {
  if (_elementRegistry.containsKey(name)) {
    throw Exception('An element with name "$name" has already been defined.');
  }
  _elementRegistry[name] = creator;
}