getModelByFieldValue method

T? getModelByFieldValue(
  1. String key,
  2. dynamic value
)

Returns Model With Specific Value

Implementation

T? getModelByFieldValue(String key, dynamic value) {
  for (dynamic model in _models.values) {
    if (model.getModelData(applyHiddenFields: false)[key] == value) {
      return model as T;
    }
  }
  return null;
}