rut_utils library


Class to be used as a inputFormatters of a TextFormField. It receives a TextEditingValue and format its value as a Chilean RUT.


deFormatRut(String rut) String
Returns a String with the "." and "-" removed from de rut.
formatRut(String rut) String
Returns a String with "." and "-" added to the rut.
isRutValid(String rut) bool
Evaluates whether the rut is valid or not using the oficial algorithim provided by the Chilean government.
validateRut(String? rut) String?
Returns null if the given rut is valid.