h-1 lebaran
This commit is contained in:
@ -11,8 +11,16 @@ class RegisterDonaturView extends GetView<AuthController> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Daftar Sebagai Donatur'),
|
||||
title: const Text('Daftar Donatur'),
|
||||
centerTitle: true,
|
||||
backgroundColor: Colors.blue,
|
||||
foregroundColor: Colors.white,
|
||||
elevation: 0,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.vertical(
|
||||
bottom: Radius.circular(15),
|
||||
),
|
||||
),
|
||||
),
|
||||
body: SafeArea(
|
||||
child: Padding(
|
||||
@ -23,29 +31,60 @@ class RegisterDonaturView extends GetView<AuthController> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
const SizedBox(height: 20),
|
||||
// Logo atau Judul
|
||||
const Center(
|
||||
child: Text(
|
||||
'Daftar Donatur',
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.blue,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const Center(
|
||||
child: Text(
|
||||
'Isi data untuk mendaftar sebagai donatur',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Colors.grey,
|
||||
),
|
||||
// Header dengan icon dan judul
|
||||
Container(
|
||||
padding: const EdgeInsets.all(15),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.blue.shade50,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/images/logo-disalurkita.png',
|
||||
width: 120,
|
||||
height: 120,
|
||||
),
|
||||
const Text(
|
||||
'Daftar Sebagai Donatur',
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.blue,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
const Text(
|
||||
'Bergabunglah dengan kami untuk membantu mereka yang membutuhkan',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Colors.blueGrey,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
const SizedBox(height: 20),
|
||||
// Step indicator
|
||||
const Row(
|
||||
children: [
|
||||
Icon(Icons.person_add, color: Colors.blue),
|
||||
SizedBox(width: 10),
|
||||
Text(
|
||||
'Informasi Akun',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.blue,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
const Divider(),
|
||||
const SizedBox(height: 10),
|
||||
|
||||
// Nama Lengkap
|
||||
TextFormField(
|
||||
@ -53,9 +92,22 @@ class RegisterDonaturView extends GetView<AuthController> {
|
||||
keyboardType: TextInputType.name,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Nama Lengkap',
|
||||
prefixIcon: const Icon(Icons.person),
|
||||
border: OutlineInputBorder(
|
||||
hintText: 'Masukkan nama lengkap Anda',
|
||||
prefixIcon: const Icon(Icons.person, color: Colors.blue),
|
||||
filled: true,
|
||||
fillColor: Colors.grey.shade100,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide: BorderSide(color: Colors.grey.shade300),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide:
|
||||
const BorderSide(color: Colors.blue, width: 2),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide: const BorderSide(color: Colors.red),
|
||||
),
|
||||
),
|
||||
validator: controller.validateDonaturNama,
|
||||
@ -68,9 +120,22 @@ class RegisterDonaturView extends GetView<AuthController> {
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Email',
|
||||
prefixIcon: const Icon(Icons.email),
|
||||
border: OutlineInputBorder(
|
||||
hintText: 'contoh@email.com',
|
||||
prefixIcon: const Icon(Icons.email, color: Colors.blue),
|
||||
filled: true,
|
||||
fillColor: Colors.grey.shade100,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide: BorderSide(color: Colors.grey.shade300),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide:
|
||||
const BorderSide(color: Colors.blue, width: 2),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide: const BorderSide(color: Colors.red),
|
||||
),
|
||||
),
|
||||
validator: controller.validateEmail,
|
||||
@ -78,34 +143,101 @@ class RegisterDonaturView extends GetView<AuthController> {
|
||||
const SizedBox(height: 15),
|
||||
|
||||
// Password
|
||||
TextFormField(
|
||||
controller: controller.passwordController,
|
||||
obscureText: true,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Password',
|
||||
prefixIcon: const Icon(Icons.lock),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
),
|
||||
validator: controller.validatePassword,
|
||||
),
|
||||
Obx(() => TextFormField(
|
||||
controller: controller.passwordController,
|
||||
obscureText: controller.isPasswordHidden.value,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Password',
|
||||
hintText: 'Minimal 8 karakter',
|
||||
prefixIcon:
|
||||
const Icon(Icons.lock, color: Colors.blue),
|
||||
suffixIcon: IconButton(
|
||||
icon: Icon(
|
||||
controller.isPasswordHidden.value
|
||||
? Icons.visibility_off
|
||||
: Icons.visibility,
|
||||
color: Colors.blue,
|
||||
),
|
||||
onPressed: () =>
|
||||
controller.togglePasswordVisibility(),
|
||||
),
|
||||
filled: true,
|
||||
fillColor: Colors.grey.shade100,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide: BorderSide(color: Colors.grey.shade300),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide:
|
||||
const BorderSide(color: Colors.blue, width: 2),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide: const BorderSide(color: Colors.red),
|
||||
),
|
||||
),
|
||||
validator: controller.validatePassword,
|
||||
)),
|
||||
const SizedBox(height: 15),
|
||||
|
||||
// Confirm Password
|
||||
TextFormField(
|
||||
controller: controller.confirmPasswordController,
|
||||
obscureText: true,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Konfirmasi Password',
|
||||
prefixIcon: const Icon(Icons.lock_outline),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
Obx(() => TextFormField(
|
||||
controller: controller.confirmPasswordController,
|
||||
obscureText: controller.isConfirmPasswordHidden.value,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Konfirmasi Password',
|
||||
hintText: 'Masukkan password yang sama',
|
||||
prefixIcon: const Icon(Icons.lock_outline,
|
||||
color: Colors.blue),
|
||||
suffixIcon: IconButton(
|
||||
icon: Icon(
|
||||
controller.isConfirmPasswordHidden.value
|
||||
? Icons.visibility_off
|
||||
: Icons.visibility,
|
||||
color: Colors.blue,
|
||||
),
|
||||
onPressed: () =>
|
||||
controller.toggleConfirmPasswordVisibility(),
|
||||
),
|
||||
filled: true,
|
||||
fillColor: Colors.grey.shade100,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide: BorderSide(color: Colors.grey.shade300),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide:
|
||||
const BorderSide(color: Colors.blue, width: 2),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide: const BorderSide(color: Colors.red),
|
||||
),
|
||||
),
|
||||
validator: controller.validateConfirmPassword,
|
||||
)),
|
||||
const SizedBox(height: 15),
|
||||
|
||||
// Section heading
|
||||
const Row(
|
||||
children: [
|
||||
Icon(Icons.person_pin_circle, color: Colors.blue),
|
||||
SizedBox(width: 10),
|
||||
Text(
|
||||
'Informasi Profil',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.blue,
|
||||
),
|
||||
),
|
||||
),
|
||||
validator: controller.validateConfirmPassword,
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
const Divider(),
|
||||
const SizedBox(height: 10),
|
||||
|
||||
// No HP
|
||||
TextFormField(
|
||||
@ -113,9 +245,22 @@ class RegisterDonaturView extends GetView<AuthController> {
|
||||
keyboardType: TextInputType.phone,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Nomor HP',
|
||||
prefixIcon: const Icon(Icons.phone),
|
||||
border: OutlineInputBorder(
|
||||
hintText: 'Masukkan nomor HP aktif',
|
||||
prefixIcon: const Icon(Icons.phone, color: Colors.blue),
|
||||
filled: true,
|
||||
fillColor: Colors.grey.shade100,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide: BorderSide(color: Colors.grey.shade300),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide:
|
||||
const BorderSide(color: Colors.blue, width: 2),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide: const BorderSide(color: Colors.red),
|
||||
),
|
||||
),
|
||||
validator: controller.validateDonaturNoHp,
|
||||
@ -128,10 +273,23 @@ class RegisterDonaturView extends GetView<AuthController> {
|
||||
keyboardType: TextInputType.streetAddress,
|
||||
maxLines: 2,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Alamat',
|
||||
prefixIcon: const Icon(Icons.home),
|
||||
border: OutlineInputBorder(
|
||||
labelText: 'Alamat Lengkap',
|
||||
hintText: 'Masukkan alamat lengkap Anda',
|
||||
prefixIcon: const Icon(Icons.home, color: Colors.blue),
|
||||
filled: true,
|
||||
fillColor: Colors.grey.shade100,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide: BorderSide(color: Colors.grey.shade300),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide:
|
||||
const BorderSide(color: Colors.blue, width: 2),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide: const BorderSide(color: Colors.red),
|
||||
),
|
||||
),
|
||||
validator: controller.validateDonaturAlamat,
|
||||
@ -139,70 +297,160 @@ class RegisterDonaturView extends GetView<AuthController> {
|
||||
const SizedBox(height: 15),
|
||||
|
||||
// Jenis Donatur (Dropdown)
|
||||
DropdownButtonFormField<String>(
|
||||
value: controller.jenisController.text.isEmpty
|
||||
? 'Individu'
|
||||
: controller.jenisController.text,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Jenis Donatur',
|
||||
prefixIcon: const Icon(Icons.category),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey.shade100,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(color: Colors.grey.shade300),
|
||||
),
|
||||
child: DropdownButtonFormField<String>(
|
||||
value: controller.jenisController.text.isEmpty
|
||||
? 'Individu'
|
||||
: controller.jenisController.text,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Jenis Donatur',
|
||||
prefixIcon:
|
||||
const Icon(Icons.category, color: Colors.blue),
|
||||
border: InputBorder.none,
|
||||
contentPadding:
|
||||
const EdgeInsets.symmetric(horizontal: 10),
|
||||
),
|
||||
items: const [
|
||||
DropdownMenuItem(
|
||||
value: 'Individu', child: Text('Individu')),
|
||||
DropdownMenuItem(
|
||||
value: 'Organisasi', child: Text('Organisasi')),
|
||||
DropdownMenuItem(
|
||||
value: 'Perusahaan', child: Text('Perusahaan')),
|
||||
DropdownMenuItem(
|
||||
value: 'Lainnya', child: Text('Lainnya')),
|
||||
],
|
||||
onChanged: (value) {
|
||||
controller.jenisController.text = value ?? 'Individu';
|
||||
},
|
||||
),
|
||||
items: const [
|
||||
DropdownMenuItem(
|
||||
value: 'Individu', child: Text('Individu')),
|
||||
DropdownMenuItem(
|
||||
value: 'Organisasi', child: Text('Organisasi')),
|
||||
DropdownMenuItem(
|
||||
value: 'Perusahaan', child: Text('Perusahaan')),
|
||||
DropdownMenuItem(
|
||||
value: 'Lainnya', child: Text('Lainnya')),
|
||||
],
|
||||
onChanged: (value) {
|
||||
controller.jenisController.text = value ?? 'Individu';
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
|
||||
// Register Button
|
||||
Obx(() => ElevatedButton(
|
||||
onPressed: controller.isLoading.value
|
||||
? null
|
||||
: controller.registerDonatur,
|
||||
style: ElevatedButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(vertical: 15),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
),
|
||||
child: controller.isLoading.value
|
||||
? const SpinKitThreeBounce(
|
||||
color: Colors.white,
|
||||
size: 24,
|
||||
)
|
||||
: const Text(
|
||||
'DAFTAR',
|
||||
const SizedBox(height: 25),
|
||||
|
||||
// Catatan Informasi
|
||||
Container(
|
||||
padding: const EdgeInsets.all(15),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.blue.shade50,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(color: Colors.blue.shade200),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.info_outline, color: Colors.blue),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: const [
|
||||
Text(
|
||||
'Informasi',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.blue,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 5),
|
||||
Text(
|
||||
'Data Anda akan terverifikasi dan terlindungi. Kami menjaga privasi dan keamanan data Anda.',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Colors.blueGrey,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 25),
|
||||
|
||||
// Register Button
|
||||
Obx(() => Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.blue.withOpacity(0.3),
|
||||
spreadRadius: 1,
|
||||
blurRadius: 3,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: ElevatedButton(
|
||||
onPressed: controller.isLoading.value
|
||||
? null
|
||||
: controller.registerDonatur,
|
||||
style: ElevatedButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(vertical: 15),
|
||||
backgroundColor: Colors.blue,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
elevation: 0,
|
||||
),
|
||||
child: controller.isLoading.value
|
||||
? const SpinKitThreeBounce(
|
||||
color: Colors.white,
|
||||
size: 24,
|
||||
)
|
||||
: const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(Icons.how_to_reg, color: Colors.white),
|
||||
SizedBox(width: 10),
|
||||
Text(
|
||||
'DAFTAR SEKARANG',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)),
|
||||
const SizedBox(height: 20),
|
||||
|
||||
// Login Link
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Text('Sudah punya akun?'),
|
||||
TextButton(
|
||||
onPressed: () => Get.offAllNamed(Routes.login),
|
||||
child: const Text('Masuk'),
|
||||
),
|
||||
],
|
||||
Container(
|
||||
padding: const EdgeInsets.all(15),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey.shade50,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(color: Colors.grey.shade200),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Text(
|
||||
'Sudah punya akun?',
|
||||
style: TextStyle(color: Colors.grey),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Get.offAllNamed(Routes.login),
|
||||
child: const Text(
|
||||
'Masuk',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.blue,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
Reference in New Issue
Block a user