getWidgetBuilder method

JsonWidgetBuilderBuilder getWidgetBuilder(
  1. String type
)

Returns the builder for the requested type. This will first search the registered custom builders, then if no builder is found, this will then search the library provided builders.

If no builder is registered for the given type then this will throw an Exception.

Implementation

JsonWidgetBuilderBuilder getWidgetBuilder(String type) {
  final container = _builders[type];

  final builder = container?.builder ?? _parent?.getWidgetBuilder(type);

  if (builder == null) {
    throw Exception(
      'No widget with type: "$type" found in the registry [$debugLabel].',
    );
  }

  return builder;
}