cvAddConstructors<T extends CvModel> function

void cvAddConstructors<T extends CvModel>(
  1. List<CvModelDefaultBuilderFunction<T>> builders
)

Add convenient constructors tear-off

Warning each builder must be of the same base type i.e. use a different construction for CvMapModel and CvModelBase models and other based)

Implementation

void cvAddConstructors<T extends CvModel>(
  List<CvModelDefaultBuilderFunction<T>> builders,
) {
  for (var builder in builders) {
    /// Here T might not be ok so lets build it!
    var object = builder();
    cvTypeAddBuilder(object.runtimeType, (contextData) => builder());
  }
}