getTemplateByType static method

TypeTemplate? getTemplateByType(
  1. Type type
)
Get a template by type from the templates warehouse. If not in the warehouse, a new TypeTemplate is created and added to the warehouse. .Net type.

Implementation

static TypeTemplate? getTemplateByType(Type type) {
  // loaded ?
  for (var tmps in _templates.values)
    for (var tmp in tmps.values) if (tmp.definedType == type) return tmp;

  //try {
  var template = new TypeTemplate.fromType(type, true);
  return template;
  //} catch (ex) {
  //  return null;
  //}
}