defineElement function
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;
}