h-1 lebaran

This commit is contained in:
Khafidh Fuadi
2025-03-30 14:45:16 +07:00
parent c008020705
commit 5aaeb58d2b
91 changed files with 9448 additions and 3756 deletions

View File

@ -10,140 +10,360 @@ class LoginView extends GetView<AuthController> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Padding(
padding: const EdgeInsets.all(20.0),
child: SingleChildScrollView(
child: Form(
key: controller.loginFormKey,
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const SizedBox(height: 50),
// Logo atau Judul
const Center(
child: Text(
'Penyaluran App',
style: TextStyle(
fontSize: 28,
fontWeight: FontWeight.bold,
color: Colors.blue,
body: Container(
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [Color(0xFFE3F2FD), Colors.white],
),
),
child: SafeArea(
child: Padding(
padding: const EdgeInsets.all(24.0),
child: SingleChildScrollView(
child: Form(
key: controller.loginFormKey,
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
// Logo
Center(
child: Image.asset(
'assets/images/logo-disalurkita.png',
width: 250,
height: 250,
),
),
),
const SizedBox(height: 10),
const Center(
child: Text(
'Masuk ke akun Anda',
style: TextStyle(
fontSize: 16,
color: Colors.grey,
const Center(
child: Text(
'Masuk ke akun Anda',
style: TextStyle(
fontSize: 16,
color: Color(0xFF546E7A),
fontWeight: FontWeight.w500,
),
),
),
),
const SizedBox(height: 50),
const SizedBox(height: 20),
// Email Field
TextFormField(
controller: controller.emailController,
keyboardType: TextInputType.emailAddress,
decoration: InputDecoration(
labelText: 'Email',
prefixIcon: const Icon(Icons.email),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
// Email Field
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(15),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.05),
blurRadius: 10,
spreadRadius: 1,
),
],
),
child: TextFormField(
controller: controller.emailController,
keyboardType: TextInputType.emailAddress,
decoration: InputDecoration(
hintText: 'Masukkan email Anda',
labelText: 'Email',
prefixIcon:
const Icon(Icons.email, color: Color(0xFF1565C0)),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: BorderSide.none,
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: BorderSide.none,
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: const BorderSide(
color: Color(0xFF1565C0), width: 1.5),
),
errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide:
const BorderSide(color: Colors.red, width: 1.5),
),
fillColor: Colors.white,
filled: true,
),
validator: controller.validateEmail,
),
),
validator: controller.validateEmail,
),
const SizedBox(height: 20),
const SizedBox(height: 20),
// Password Field
TextFormField(
controller: controller.passwordController,
obscureText: true,
decoration: InputDecoration(
labelText: 'Password',
prefixIcon: const Icon(Icons.lock),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
// Password Field
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(15),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.05),
blurRadius: 10,
spreadRadius: 1,
),
],
),
child: Obx(() => TextFormField(
controller: controller.passwordController,
obscureText: controller.isPasswordHidden.value,
decoration: InputDecoration(
hintText: 'Masukkan password Anda',
labelText: 'Password',
prefixIcon: const Icon(Icons.lock,
color: Color(0xFF1565C0)),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: BorderSide.none,
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: BorderSide.none,
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: const BorderSide(
color: Color(0xFF1565C0), width: 1.5),
),
errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: const BorderSide(
color: Colors.red, width: 1.5),
),
fillColor: Colors.white,
filled: true,
suffixIcon: IconButton(
onPressed: () {
controller.isPasswordHidden.value =
!controller.isPasswordHidden.value;
},
icon: Icon(
!controller.isPasswordHidden.value
? Icons.visibility
: Icons.visibility_off,
color: const Color(0xFF78909C),
),
splashRadius: 20,
),
),
validator: controller.validatePassword,
)),
),
validator: controller.validatePassword,
),
const SizedBox(height: 10),
const SizedBox(height: 10),
// Forgot Password
Align(
alignment: Alignment.centerRight,
child: TextButton(
onPressed: () {
// Implementasi lupa password
},
child: const Text('Lupa Password?'),
),
),
const SizedBox(height: 20),
// Login Button
Obx(() => ElevatedButton(
onPressed: controller.isLoading.value
? null
: controller.login,
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.symmetric(vertical: 15),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
// Forgot Password
Align(
alignment: Alignment.centerRight,
child: TextButton(
onPressed: () => Get.toNamed(Routes.forgotPassword),
style: TextButton.styleFrom(
foregroundColor: const Color(0xFF1565C0),
),
child: const Text(
'Lupa Password?',
style: TextStyle(
fontWeight: FontWeight.w600,
),
),
child: controller.isLoading.value
? const SpinKitThreeBounce(
color: Colors.white,
size: 24,
)
: const Text(
'MASUK',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 20),
// Login Button
Obx(() => Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
boxShadow: [
BoxShadow(
color: const Color(0xFF1565C0).withOpacity(0.3),
blurRadius: 10,
spreadRadius: 1,
offset: const Offset(0, 4),
),
],
),
child: ElevatedButton(
onPressed: controller.isLoading.value
? null
: controller.login,
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.symmetric(vertical: 15),
backgroundColor: const Color(0xFF1565C0),
foregroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15),
),
elevation: 0,
),
child: controller.isLoading.value
? const SpinKitThreeBounce(
color: Colors.white,
size: 24,
)
: const Text(
'MASUK',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
letterSpacing: 1,
),
),
),
)),
const SizedBox(height: 30),
// Divider
Row(
children: [
Expanded(
child: Container(
height: 1,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Colors.grey.withOpacity(0.1),
Colors.grey.withOpacity(0.5),
],
begin: Alignment.centerRight,
end: Alignment.centerLeft,
),
),
),
),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 16.0),
child: Text(
'ATAU',
style: TextStyle(
color: Color(0xFF546E7A),
fontWeight: FontWeight.w600,
fontSize: 14,
),
),
),
Expanded(
child: Container(
height: 1,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Colors.grey.withOpacity(0.1),
Colors.grey.withOpacity(0.5),
],
begin: Alignment.centerLeft,
end: Alignment.centerRight,
),
),
),
),
],
),
const SizedBox(height: 30),
// Register Donatur Button
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.05),
blurRadius: 10,
spreadRadius: 1,
),
],
),
child: OutlinedButton(
onPressed: () => Get.toNamed(Routes.registerDonatur),
style: OutlinedButton.styleFrom(
padding: const EdgeInsets.symmetric(vertical: 15),
foregroundColor: const Color(0xFF1565C0),
side: const BorderSide(
color: Color(0xFF1565C0), width: 1.5),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15),
),
),
child: const Text(
'DAFTAR SEBAGAI DONATUR',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
letterSpacing: 1,
),
),
),
),
const SizedBox(height: 40),
// Informasi Pendaftaran Warga
Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: const Color(0xFFFFF8E1),
borderRadius: BorderRadius.circular(15),
border: Border.all(
color: const Color(0xFFFFCC80), width: 1),
),
child: Column(
children: [
Row(
children: [
Container(
padding: const EdgeInsets.all(8),
decoration: const BoxDecoration(
color: Color(0xFFFFCC80),
shape: BoxShape.circle,
),
child: const Icon(
Icons.info_outline,
color: Color(0xFFE65100),
size: 24,
),
),
)),
const SizedBox(height: 20),
// Divider
const Row(
children: [
Expanded(child: Divider()),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.0),
child:
Text('ATAU', style: TextStyle(color: Colors.grey)),
),
Expanded(child: Divider()),
],
),
const SizedBox(height: 20),
// Register Donatur Button
OutlinedButton(
onPressed: () => Get.toNamed(Routes.registerDonatur),
style: OutlinedButton.styleFrom(
padding: const EdgeInsets.symmetric(vertical: 15),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
side: const BorderSide(color: Colors.blue),
),
child: const Text(
'DAFTAR SEBAGAI DONATUR',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
const SizedBox(width: 12),
const Expanded(
child: Text(
'Informasi Penting',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Color(0xFFE65100),
),
),
),
],
),
const SizedBox(height: 12),
const Text(
'Pendaftaran warga hanya dapat dilakukan melalui aplikasi verifikasi data warga. Silahkan hubungi petugas atau kunjungi kantor untuk informasi lebih lanjut.',
style: TextStyle(
fontSize: 14,
color: Color(0xFF424242),
height: 1.5,
),
),
],
),
),
),
],
const SizedBox(height: 30),
// Footer
Center(
child: Text(
'© ${DateTime.now().year} DisalurKita',
style: TextStyle(
fontSize: 12,
color: Color(0xFF90A4AE),
),
),
),
],
),
),
),
),