well_formed 0.2.0 well_formed: ^0.2.0 copied to clipboard
A form field package designed to relieve the developer of much of the form-related coding by providing ready-to-use field masking, validation, smart trimming, and more.
import 'package:eo_color/eo_color.dart';
import 'package:flutter/material.dart';
import 'package:well_formed/well_formed.dart';
void main() {
runApp(const _DemoApp());
}
/// Demo purposes form app widget.
class _DemoApp extends StatelessWidget {
/// Ctor.
const _DemoApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Simple form demo',
home: Scaffold(
appBar: AppBar(
backgroundColor: const Cyan().color,
elevation: 0.0,
title: const Text('A Form and its fields'),
),
body: Center(
child: SizedBox(
width: 350,
child: WellFormed.btn([
BasicTextField(
trim: true,
blank: 'Please fill in this field',
decoration: const InputDecoration(labelText: 'Enter some text'),
),
DigitField.len(
5,
diff: 'Please enter exactly 5 digits; for example, 22335.',
blank: 'Please enter 5 digits',
decoration: const InputDecoration(labelText: 'Enter 5 digits'),
),
CepField(blank: 'Please enter the CEP value'),
]),
),
),
),
);
}
}