mask 1.0.1 mask: ^1.0.1 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
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: const HomePage(),
);
}
}
class HomePage extends StatelessWidget {
const 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.money(value, min: 100.0),
inputFormatters: [Mask.money()],
),
],
),
),
);
}
}