mask 1.0.5 copy "mask: ^1.0.5" to clipboard
mask: ^1.0.5 copied to clipboard

This project is for you to be able to make validations and formatting in a simple and easy way in your projects

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:mask/mask/mask.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(),
      home: HomePage(),
    );
  }
}

class HomePage extends StatelessWidget {
  final editController = TextEditingController();

  HomePage({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(),
      body: Padding(
        padding: const EdgeInsets.all(8.0),
        child: Column(
          children: [
            TextFormField(
              autovalidateMode: AutovalidateMode.onUserInteraction,
              validator: (value) => Mask.validations.cpf(value),
              inputFormatters: [Mask.cpf()],
              decoration: const InputDecoration(labelText: 'CPF'),
            ),
            TextFormField(
              inputFormatters: [Mask.phone()],
              decoration: const InputDecoration(labelText: 'TElefone'),
            ),
          ],
        ),
      ),
    );
  }
}
35
likes
160
points
451
downloads

Publisher

unverified uploader

Weekly Downloads

This project is for you to be able to make validations and formatting in a simple and easy way in your projects

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on mask