ValidaDuration.fromJson constructor

ValidaDuration.fromJson(
  1. Map<String, Object?> map
)

Implementation

factory ValidaDuration.fromJson(Map<String, Object?> map) {
  return ValidaDuration(
    min: map['min'] == null
        ? null
        : Duration(microseconds: map['min']! as int),
    max: map['max'] == null
        ? null
        : Duration(microseconds: map['max']! as int),
    customValidateName: map['customValidate'] as String?,
    comp: map['comp'] == null
        ? null
        : ValidaComparison.fromJson(map['comp']! as Map<String, Object?>),
  );
}