createInstance<T extends DataModel> static method

T createInstance<T extends DataModel>(
  1. Type type
)

Implementation

static T createInstance<T extends DataModel>(Type type) {
  final ModelType modelType = _modelTypes[type]!;
  final T instance = modelType.constructor() as T;
  return instance;
}