From 6ed5c16782a9c320ff9a59ac7f01f43c6151278c Mon Sep 17 00:00:00 2001 From: Matthew Patrick Date: Fri, 13 May 2022 00:42:23 +0700 Subject: [PATCH] register_form - Changed Fields KeyboardType --- lib/components/register_form.dart | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/lib/components/register_form.dart b/lib/components/register_form.dart index f13945e..f541454 100644 --- a/lib/components/register_form.dart +++ b/lib/components/register_form.dart @@ -76,14 +76,22 @@ class RegisterFormState extends State { child: Column( children: [ makeInput( - label: "First Name", icon: Icons.person), - makeInput(label: "Last Name", icon: Icons.person), + label: "First Name", + icon: Icons.person, + keyboardType: TextInputType.name), 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( label: "Password", obscureText: true, - icon: Icons.lock) + icon: Icons.lock, + keyboardType: TextInputType.text) ], ), ), @@ -148,7 +156,10 @@ class RegisterFormState extends State { ), onPressed: () { 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 { } } -Widget makeInput({label, obscureText = false, icon}) { +Widget makeInput({label, obscureText = false, icon, keyboardType}) { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -192,6 +203,7 @@ Widget makeInput({label, obscureText = false, icon}) { child: FormBuilderTextField( initialValue: "", name: label, + keyboardType: keyboardType, obscureText: obscureText, style: const TextStyle(color: Colors.white), decoration: InputDecoration(