mask_shifter 0.1.0 copy "mask_shifter: ^0.1.0" to clipboard
mask_shifter: ^0.1.0 copied to clipboard

Library to change the mask of a textfield automatically when the number of characters typed change

example/example.dart

import 'package:flutter/material.dart';
//Componentes
import 'package:mask_shifter/mask_shifter.dart';

class UsersData extends StatefulWidget {
  UsersData({Key key}) : super(key: key);

  @override
  _UsersData createState() => _UsersData();
}

class _UsersData extends State<UsersData> {
  @override
  void initState() {
    // TODO: implement initState
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: NestedScrollView(
        body: ListView(
          children: <Widget>[
            Padding(
              padding: const EdgeInsets.all(8.0),
              child: TextField(
                //HERE IS HOW USE THE LIBRARY
                inputFormatters: [
                  MaskedTextInputFormatterShifter(
                      maskONE: "XXX.XXX.XXX-XX", maskTWO: "XX.XXX.XXX/XXXX-XX"),
                ],
                decoration: InputDecoration(
                  border: OutlineInputBorder(),
                  labelText: "CPF/CNPJ MASK",
                  labelStyle: TextStyle(fontWeight: FontWeight.bold),
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
6
likes
30
pub points
74%
popularity

Publisher

unverified uploader

Library to change the mask of a textfield automatically when the number of characters typed change

Repository (GitHub)
View/report issues

License

Apache-2.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on mask_shifter