register_form - Changed Fields KeyboardType

This commit is contained in:
Matthew Patrick 2022-05-13 00:42:23 +07:00
parent 319a7dae6e
commit 6ed5c16782

View file

@ -76,14 +76,22 @@ class RegisterFormState extends State<RegisterForm> {
child: Column( child: Column(
children: [ children: [
makeInput( makeInput(
label: "First Name", icon: Icons.person), label: "First Name",
makeInput(label: "Last Name", icon: Icons.person), icon: Icons.person,
keyboardType: TextInputType.name),
makeInput( makeInput(
label: "Email Address", icon: Icons.email), label: "Last Name",
icon: Icons.person,
keyboardType: TextInputType.name),
makeInput(
label: "Email Address",
icon: Icons.email,
keyboardType: TextInputType.emailAddress),
makeInput( makeInput(
label: "Password", label: "Password",
obscureText: true, obscureText: true,
icon: Icons.lock) icon: Icons.lock,
keyboardType: TextInputType.text)
], ],
), ),
), ),
@ -148,7 +156,10 @@ class RegisterFormState extends State<RegisterForm> {
), ),
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
Navigator.push(context, MaterialPageRoute(builder: (context) => const Login())); Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const Login()));
}, },
), ),
], ],
@ -165,7 +176,7 @@ class RegisterFormState extends State<RegisterForm> {
} }
} }
Widget makeInput({label, obscureText = false, icon}) { Widget makeInput({label, obscureText = false, icon, keyboardType}) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -192,6 +203,7 @@ Widget makeInput({label, obscureText = false, icon}) {
child: FormBuilderTextField( child: FormBuilderTextField(
initialValue: "", initialValue: "",
name: label, name: label,
keyboardType: keyboardType,
obscureText: obscureText, obscureText: obscureText,
style: const TextStyle(color: Colors.white), style: const TextStyle(color: Colors.white),
decoration: InputDecoration( decoration: InputDecoration(