Perbarui sintaks Dart dan perbaiki opacity warna
- Ganti `Key? key` dengan `super.key` di berbagai tampilan - Gunakan `withAlpha()` sebagai pengganti `withOpacity()` untuk transparansi warna - Lakukan penyesuaian kecil pada tata letak dan styling komponen - Hapus impor yang tidak digunakan - Sederhanakan beberapa bagian kode dashboard
This commit is contained in:
@ -2,10 +2,9 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||||
import 'package:penyaluran_app/app/modules/auth/controllers/auth_controller.dart';
|
import 'package:penyaluran_app/app/modules/auth/controllers/auth_controller.dart';
|
||||||
import 'package:penyaluran_app/app/routes/app_pages.dart';
|
|
||||||
|
|
||||||
class LoginView extends GetView<AuthController> {
|
class LoginView extends GetView<AuthController> {
|
||||||
const LoginView({Key? key}) : super(key: key);
|
const LoginView({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -3,7 +3,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:penyaluran_app/app/modules/dashboard/controllers/dashboard_controller.dart';
|
import 'package:penyaluran_app/app/modules/dashboard/controllers/dashboard_controller.dart';
|
||||||
|
|
||||||
class DonaturDashboardView extends GetView<DashboardController> {
|
class DonaturDashboardView extends GetView<DashboardController> {
|
||||||
const DonaturDashboardView({Key? key}) : super(key: key);
|
const DonaturDashboardView({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -145,8 +145,8 @@ class DonaturDashboardView extends GetView<DashboardController> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
// Navigasi ke halaman penitipan bantuan baru
|
// Navigasi ke halaman penitipan bantuan baru
|
||||||
},
|
},
|
||||||
child: const Icon(Icons.add),
|
|
||||||
tooltip: 'Titipkan Bantuan Baru',
|
tooltip: 'Titipkan Bantuan Baru',
|
||||||
|
child: const Icon(Icons.add),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -187,7 +187,7 @@ class DonaturDashboardView extends GetView<DashboardController> {
|
|||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: color.withOpacity(0.1),
|
color: color.withAlpha(26),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
|
@ -5,20 +5,20 @@ import 'package:penyaluran_app/app/modules/dashboard/controllers/dashboard_contr
|
|||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
|
||||||
class PetugasDesaDashboardView extends GetView<DashboardController> {
|
class PetugasDesaDashboardView extends GetView<DashboardController> {
|
||||||
const PetugasDesaDashboardView({Key? key}) : super(key: key);
|
const PetugasDesaDashboardView({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final TextTheme textTheme =
|
final TextTheme textTheme =
|
||||||
GoogleFonts.dmSansTextTheme(Theme.of(context).textTheme);
|
GoogleFonts.dmSansTextTheme(Theme.of(context).textTheme);
|
||||||
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
|
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
|
|
||||||
return Theme(
|
return Theme(
|
||||||
data: Theme.of(context).copyWith(
|
data: Theme.of(context).copyWith(
|
||||||
textTheme: textTheme,
|
textTheme: textTheme,
|
||||||
),
|
),
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
key: _scaffoldKey,
|
key: scaffoldKey,
|
||||||
drawer: Drawer(
|
drawer: Drawer(
|
||||||
child: ListView(
|
child: ListView(
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
@ -67,7 +67,6 @@ class PetugasDesaDashboardView extends GetView<DashboardController> {
|
|||||||
'assets/icons/home-icon.svg',
|
'assets/icons/home-icon.svg',
|
||||||
width: 24,
|
width: 24,
|
||||||
height: 24,
|
height: 24,
|
||||||
color: Colors.grey[700],
|
|
||||||
),
|
),
|
||||||
title: const Text('Beranda'),
|
title: const Text('Beranda'),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
@ -120,7 +119,7 @@ class PetugasDesaDashboardView extends GetView<DashboardController> {
|
|||||||
children: [
|
children: [
|
||||||
// add drawer button
|
// add drawer button
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () => _scaffoldKey.currentState?.openDrawer(),
|
onPressed: () => scaffoldKey.currentState?.openDrawer(),
|
||||||
icon: const Icon(Icons.menu),
|
icon: const Icon(Icons.menu),
|
||||||
),
|
),
|
||||||
// Header dengan greeting
|
// Header dengan greeting
|
||||||
@ -221,7 +220,7 @@ class PetugasDesaDashboardView extends GetView<DashboardController> {
|
|||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Colors.grey.withOpacity(0.1),
|
color: Colors.grey.withAlpha(26), // 0.1 * 255 ≈ 26
|
||||||
spreadRadius: 1,
|
spreadRadius: 1,
|
||||||
blurRadius: 3,
|
blurRadius: 3,
|
||||||
offset: const Offset(0, 1),
|
offset: const Offset(0, 1),
|
||||||
@ -277,7 +276,7 @@ class PetugasDesaDashboardView extends GetView<DashboardController> {
|
|||||||
title,
|
title,
|
||||||
style: textTheme.bodyMedium?.copyWith(
|
style: textTheme.bodyMedium?.copyWith(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: Colors.white.withOpacity(0.8),
|
color: Colors.white.withAlpha(204), // 0.8 * 255 ≈ 204
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
@ -341,7 +340,7 @@ class PetugasDesaDashboardView extends GetView<DashboardController> {
|
|||||||
title,
|
title,
|
||||||
style: textTheme.bodyMedium?.copyWith(
|
style: textTheme.bodyMedium?.copyWith(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: Colors.white.withOpacity(0.8),
|
color: Colors.white.withAlpha(204), // 0.8 * 255 ≈ 204
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
@ -366,25 +365,14 @@ class PetugasDesaDashboardView extends GetView<DashboardController> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildProgressSection(TextTheme textTheme) {
|
Widget _buildProgressSection(TextTheme textTheme) {
|
||||||
return Container(
|
return Column(
|
||||||
padding: const EdgeInsets.all(16),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
gradient: const LinearGradient(
|
|
||||||
begin: Alignment.topLeft,
|
|
||||||
end: Alignment.bottomRight,
|
|
||||||
colors: [Color(0xFF2E5077), Color(0xFF5882B1)],
|
|
||||||
transform: GradientRotation(96.93 * 3.14159 / 180),
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(12),
|
|
||||||
),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Progress Penyaluran',
|
'Progress Penyaluran',
|
||||||
style: textTheme.bodyMedium?.copyWith(
|
style: textTheme.titleMedium?.copyWith(
|
||||||
fontSize: 14,
|
fontSize: 16,
|
||||||
color: Colors.white.withOpacity(0.8),
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
@ -393,17 +381,17 @@ class PetugasDesaDashboardView extends GetView<DashboardController> {
|
|||||||
child: LinearProgressIndicator(
|
child: LinearProgressIndicator(
|
||||||
value: 0.7,
|
value: 0.7,
|
||||||
minHeight: 10,
|
minHeight: 10,
|
||||||
backgroundColor: Colors.white.withOpacity(0.3),
|
backgroundColor: Colors.grey[300],
|
||||||
valueColor: const AlwaysStoppedAnimation<Color>(Colors.white),
|
valueColor: const AlwaysStoppedAnimation<Color>(Color(0xFF2E5077)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Text(
|
Text(
|
||||||
'70% Selesai',
|
'70% Selesai',
|
||||||
style: textTheme.bodyMedium?.copyWith(
|
style: textTheme.bodyMedium?.copyWith(
|
||||||
fontSize: 16,
|
fontSize: 14,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: Colors.white,
|
color: const Color(0xFF2E5077),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
@ -415,11 +403,10 @@ class PetugasDesaDashboardView extends GetView<DashboardController> {
|
|||||||
'Total : 100 Penerima, Telah Disalurkan : 70 Penerima, Belum Disalurkan : 30',
|
'Total : 100 Penerima, Telah Disalurkan : 70 Penerima, Belum Disalurkan : 30',
|
||||||
style: textTheme.bodySmall?.copyWith(
|
style: textTheme.bodySmall?.copyWith(
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color: Colors.white.withOpacity(0.8),
|
color: Colors.grey[600],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -455,7 +442,7 @@ class PetugasDesaDashboardView extends GetView<DashboardController> {
|
|||||||
0.7 *
|
0.7 *
|
||||||
(value / 100),
|
(value / 100),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: const Color(0xFFE4F1AC),
|
color: const Color(0xFF2E5077),
|
||||||
borderRadius: BorderRadius.circular(4),
|
borderRadius: BorderRadius.circular(4),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -552,7 +539,7 @@ class PetugasDesaDashboardView extends GetView<DashboardController> {
|
|||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Colors.grey.withOpacity(0.1),
|
color: Colors.grey.withAlpha(26), // 0.1 * 255 ≈ 26
|
||||||
spreadRadius: 1,
|
spreadRadius: 1,
|
||||||
blurRadius: 3,
|
blurRadius: 3,
|
||||||
offset: const Offset(0, 1),
|
offset: const Offset(0, 1),
|
||||||
@ -662,7 +649,7 @@ class PetugasDesaDashboardView extends GetView<DashboardController> {
|
|||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Colors.grey.withOpacity(0.1),
|
color: Colors.grey.withAlpha(26), // 0.1 * 255 ≈ 26
|
||||||
spreadRadius: 1,
|
spreadRadius: 1,
|
||||||
blurRadius: 3,
|
blurRadius: 3,
|
||||||
offset: const Offset(0, 1),
|
offset: const Offset(0, 1),
|
||||||
@ -686,7 +673,7 @@ class PetugasDesaDashboardView extends GetView<DashboardController> {
|
|||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.green.withOpacity(0.1),
|
color: Colors.green.withAlpha(26), // 0.1 * 255 ≈ 26
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -3,7 +3,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:penyaluran_app/app/modules/dashboard/controllers/dashboard_controller.dart';
|
import 'package:penyaluran_app/app/modules/dashboard/controllers/dashboard_controller.dart';
|
||||||
|
|
||||||
class PetugasVerifikasiDashboardView extends GetView<DashboardController> {
|
class PetugasVerifikasiDashboardView extends GetView<DashboardController> {
|
||||||
const PetugasVerifikasiDashboardView({Key? key}) : super(key: key);
|
const PetugasVerifikasiDashboardView({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -174,7 +174,7 @@ class PetugasVerifikasiDashboardView extends GetView<DashboardController> {
|
|||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: color.withOpacity(0.1),
|
color: color.withAlpha(26),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
|
@ -4,7 +4,7 @@ import 'package:penyaluran_app/app/modules/dashboard/controllers/dashboard_contr
|
|||||||
import 'package:penyaluran_app/app/modules/auth/controllers/auth_controller.dart';
|
import 'package:penyaluran_app/app/modules/auth/controllers/auth_controller.dart';
|
||||||
|
|
||||||
class WargaDashboardView extends GetView<DashboardController> {
|
class WargaDashboardView extends GetView<DashboardController> {
|
||||||
const WargaDashboardView({Key? key}) : super(key: key);
|
const WargaDashboardView({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -253,7 +253,7 @@ class WargaDashboardView extends GetView<DashboardController> {
|
|||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: color.withOpacity(0.1),
|
color: color.withAlpha(26),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
|
@ -3,7 +3,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:penyaluran_app/app/modules/home/controllers/home_controller.dart';
|
import 'package:penyaluran_app/app/modules/home/controllers/home_controller.dart';
|
||||||
|
|
||||||
class HomeView extends GetView<HomeController> {
|
class HomeView extends GetView<HomeController> {
|
||||||
const HomeView({Key? key}) : super(key: key);
|
const HomeView({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
Reference in New Issue
Block a user