textformfieldcustom 0.0.9 textformfieldcustom: ^0.0.9 copied to clipboard
show about textformfieldcustom
Usage #
A FormField that contains a TextField.
TextFormField(
decoration: const InputDecoration(
icon: Icon(Icons.person),
hintText: 'What do people call you?',
labelText: 'Name *',
),
onSaved: (String? value) {
// This optional block of code can be used to run
// code when the user saves the form.
},
validator: (String? value) {
return (value != null && value.contains('@')) ? 'Do not use the @ char.' : null;
Resources #
Example #
import 'package:cic_clone/utils/custom_text_field.dart';
import 'package:flutter/material.dart';
class TestScreen extends StatelessWidget {
const TestScreen({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
children: [
const CustomTextfield(
label: 'Name',
),
CustomTextfield(
label: 'Date Of Birth',
onDateTimeChanged: (v) {},
)
],
),
);
}
}