Fakultas Ilmu Komputer UI

Commit 7be2e4fc authored by Usman Sidiq's avatar Usman Sidiq
Browse files

[REFACTOR] Implement validator for registration

parent b99c741d
Pipeline #33974 passed with stages
in 1 minute and 41 seconds
...@@ -21,6 +21,7 @@ class RegistrasiState extends State<Registrasi> { ...@@ -21,6 +21,7 @@ class RegistrasiState extends State<Registrasi> {
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Form( child: Form(
key: _formKey,
child: Center( child: Center(
child: Container( child: Container(
margin: EdgeInsets.symmetric(horizontal: 20.0), margin: EdgeInsets.symmetric(horizontal: 20.0),
...@@ -40,10 +41,12 @@ class RegistrasiState extends State<Registrasi> { ...@@ -40,10 +41,12 @@ class RegistrasiState extends State<Registrasi> {
CustomTextField( CustomTextField(
title: 'Nama Lengkap', title: 'Nama Lengkap',
key: Key('Text Field Nama'), key: Key('Text Field Nama'),
validator: (input) => input.isEmpty ? "*Wajib diisi" : null,
), ),
CustomTextField( CustomTextField(
title: 'Nomor Telepon', title: 'Nomor Telepon',
key: Key('Text Field Nomor Telepon'), key: Key('Text Field Nomor Telepon'),
validator: (input) => input.isEmpty ? "*Wajib diisi" : null,
), ),
CustomTextField( CustomTextField(
title: 'Email (Opsional)', title: 'Email (Opsional)',
...@@ -52,10 +55,12 @@ class RegistrasiState extends State<Registrasi> { ...@@ -52,10 +55,12 @@ class RegistrasiState extends State<Registrasi> {
CustomTextField( CustomTextField(
title: 'Password', title: 'Password',
key: Key('Text Field Password'), key: Key('Text Field Password'),
validator: (input) => input.isEmpty ? "*Wajib diisi" : null,
), ),
CustomTextField( CustomTextField(
title: 'Konfirmasi Password', title: 'Konfirmasi Password',
key: Key('Text Field Konfirmasi Password'), key: Key('Text Field Konfirmasi Password'),
validator: (input) => input.isEmpty ? "*Wajib diisi" : null,
), ),
Container( Container(
margin: EdgeInsets.fromLTRB(0, 30, 0, 10), margin: EdgeInsets.fromLTRB(0, 30, 0, 10),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment