createDefault<T extends TextRenderer> static method

T createDefault<T extends TextRenderer>()

Given a generic type T, creates a default renderer of that type.

Implementation

static T createDefault<T extends TextRenderer>() {
  final creator = defaultRegistry[T];
  if (creator != null) {
    return creator() as T;
  } else {
    throw 'Unknown implementation of TextRenderer: $T. Please register it '
        'under [TextRendererFactory.defaultRegistry].';
  }
}