ValidaMap<K, V>.fromJson constructor

ValidaMap<K, V>.fromJson(
  1. Map<String, Object?> map
)

Implementation

factory ValidaMap.fromJson(Map<String, Object?> map) {
  return ValidaMap(
    minLength: map['minLength'] as int?,
    maxLength: map['maxLength'] as int?,
    eachKey: map['eachKey'] == null
        ? null
        : (ValidaField.fromJson(map['eachKey']! as Map<String, Object?>)
            as ValidaField<K>),
    eachValue: map['eachValue'] == null
        ? null
        : (ValidaField.fromJson(map['eachValue']! as Map<String, Object?>)
            as ValidaField<V>),
    customValidateName: map['customValidate'] as String?,
  );
}