DfBaseModel<T extends DfBaseEntity<DfBaseField>> constructor

DfBaseModel<T extends DfBaseEntity<DfBaseField>>(
  1. {@required String name,
  2. bool encrypt,
  3. List<T> entities}
)

Implementation

DfBaseModel({@required this.name, this.encrypt, this.entities}) {
  if (Mappable.factories == null) {
    Mappable.factories = {};
  }
  if (entities != null) {
    for (var ent in entities) {
      DfBaseEntity entity = ent;
      final obj = entity.newInstance();
      Mappable.factories.addAll({obj.runtimeType: () => entity.newInstance()});
    }
  }
}