PostalCodeExtension extension

Provides extension methods for PostalCode class. Contains common methods for example copyWith, toMap, fromMap, etc, that are common to all package's submodels.

on

Methods

copyWith({String? format, String? regExpPattern}) PostalCode
Creates a copy of this object with the given fields replaced with the new values. If the new values are null, the field is left unchanged. Otherwise, the field is replaced with the new value.
toMap() Map<String, String>
Converts this object object to a JSON like map.
validator({bool multiLine = false, bool caseSensitive = true, bool unicode = false, bool dotAll = false}) RegExp
Returns a RegExp object that can be used to validate postal codes.

Static Methods

fromMap(JsonMap map) PostalCode
Creates a new instance of this object from a JSON like map.