rut_utils

Last updated:

0 purchases

rut_utils Image
rut_utils Images
Add to Cart

Description:

rut utils

Rut Utils #
Rut utils library for validation and formatting of the Chilean RUT.
It uses the official algorithim published by the Chilean registry office.
Getting started #
flutter pub add rut_utils
copied to clipboard
Validation #
import 'package:rut_utils/rut_utils.dart';

var rut = '111111119';
var isValid = isRutValid(rut); // false

var rut = '11.111.111-9';
var isValid = isRutValid(rut); // false
copied to clipboard
Formatting #
import 'package:rut_utils/rut_utils.dart';

var rut = '111111119';
var formattedRut = formatRut(rut); // 11.111.111-9

var formattedRut = '11.111.111-9';
var rut = deFormatRut(formattedRut); // 111111119
copied to clipboard
Text Formatter #
import 'package:flutter/material.dart';
import 'package:rut_utils/rut_utils.dart';

Widget _buildRutFormatter() => TextFormField(
validator: validateRut,
inputFormatters: [RutFormatter()],
textCapitalization: TextCapitalization.characters,
keyboardType: TextInputType.visiblePassword,
onChanged: (value) {
// TODO: add behaiviour
},
);
copied to clipboard
From the developer(s) #
Have fun on your flutter projects!

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.