MapSchema constructor

MapSchema([
  1. dynamic keyType,
  2. dynamic valueType,
  3. bool? req,
  4. List<IValidationRule>? rules,
])

Creates a new instance of validation schema and sets its values.

  • keyType a type of map keys. Null means that keys may have any type.
  • valueType a type of map values. Null means that values may have any type.
  • required (optional) true to always require non-null values.
  • rules (optional) a list with validation rules.

See IValidationRule See TypeCode

Implementation

MapSchema(
    [dynamic keyType,
    dynamic valueType,
    bool? req,
    List<IValidationRule>? rules])
    : super(req, rules) {
  _keyType = keyType;
  _valueType = valueType;
}