membuat tampilan lebih menarik
This commit is contained in:
@ -2,27 +2,27 @@ C/C++ Structured LogO
|
|||||||
M
|
M
|
||||||
KC:\dev\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txtC
|
KC:\dev\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txtC
|
||||||
A
|
A
|
||||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD>
|
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint <08>Õ<EFBFBD><EFBFBD>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD>
|
||||||
|
|
||||||
}D:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\arm64-v8a\additional_project_files.txt <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2 <20><><EFBFBD><EFBFBD><EFBFBD>2~
|
}D:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\arm64-v8a\additional_project_files.txt <08>Õ<EFBFBD><EFBFBD>2 <20><><EFBFBD><EFBFBD><EFBFBD>2~
|
||||||
|
|
|
|
||||||
zD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\arm64-v8a\android_gradle_build.json <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD>
|
zD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\arm64-v8a\android_gradle_build.json <08>Õ<EFBFBD><EFBFBD>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD>
|
||||||
<EFBFBD>
|
<EFBFBD>
|
||||||
D:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\arm64-v8a\android_gradle_build_mini.json <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2p
|
D:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\arm64-v8a\android_gradle_build_mini.json <08>Õ<EFBFBD><EFBFBD>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2p
|
||||||
n
|
n
|
||||||
lD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\arm64-v8a\build.ninja <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<18><> <20><><EFBFBD><EFBFBD><EFBFBD>2t
|
lD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\arm64-v8a\build.ninja <08>Õ<EFBFBD><EFBFBD>2<18><> <20><><EFBFBD><EFBFBD><EFBFBD>2t
|
||||||
r
|
r
|
||||||
pD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\arm64-v8a\build.ninja.txt <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2y
|
pD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\arm64-v8a\build.ninja.txt <08>Õ<EFBFBD><EFBFBD>2y
|
||||||
w
|
w
|
||||||
uD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\arm64-v8a\build_file_index.txt <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2
|
uD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\arm64-v8a\build_file_index.txt <08>Õ<EFBFBD><EFBFBD>2
|
||||||
K <20><><EFBFBD><EFBFBD><EFBFBD>2z
|
K <20><><EFBFBD><EFBFBD><EFBFBD>2z
|
||||||
x
|
x
|
||||||
vD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\arm64-v8a\compile_commands.json <08>Õ<EFBFBD><C395>2 ~
|
vD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\arm64-v8a\compile_commands.json <08>Õ<EFBFBD><C395>2 ~
|
||||||
|
|
|
|
||||||
zD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\arm64-v8a\compile_commands.json.bin <08>Õ<EFBFBD><C395>2
|
zD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\arm64-v8a\compile_commands.json.bin <08>Õ<EFBFBD><C395>2
|
||||||
<EFBFBD>
|
<EFBFBD>
|
||||||
<EFBFBD>
|
<EFBFBD>
|
||||||
<EFBFBD>D:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\arm64-v8a\metadata_generation_command.txt <08>Õ<EFBFBD><C395>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2w
|
<EFBFBD>D:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\arm64-v8a\metadata_generation_command.txt <08>Õ<EFBFBD><C395>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2w
|
||||||
u
|
u
|
||||||
sD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\arm64-v8a\prefab_config.json <08>Õ<EFBFBD><C395>2
|
sD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\arm64-v8a\prefab_config.json <08>Õ<EFBFBD><C395>2
|
||||||
( <20><><EFBFBD><EFBFBD><EFBFBD>2|
|
( <20><><EFBFBD><EFBFBD><EFBFBD>2|
|
@ -2,27 +2,27 @@ C/C++ Structured LogO
|
|||||||
M
|
M
|
||||||
KC:\dev\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txtC
|
KC:\dev\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txtC
|
||||||
A
|
A
|
||||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD>
|
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint <08>ȕ<EFBFBD><EFBFBD>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD>
|
||||||
<EFBFBD>
|
<EFBFBD>
|
||||||
D:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\armeabi-v7a\additional_project_files.txt <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2 <20><><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD>
|
D:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\armeabi-v7a\additional_project_files.txt <08>ȕ<EFBFBD><EFBFBD>2 <20><><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD>
|
||||||
~
|
~
|
||||||
|D:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\armeabi-v7a\android_gradle_build.json <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD>
|
|D:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\armeabi-v7a\android_gradle_build.json <08>ȕ<EFBFBD><EFBFBD>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD>
|
||||||
<EFBFBD>
|
<EFBFBD>
|
||||||
<EFBFBD>D:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\armeabi-v7a\android_gradle_build_mini.json <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2r
|
<EFBFBD>D:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\armeabi-v7a\android_gradle_build_mini.json <08>ȕ<EFBFBD><EFBFBD>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2r
|
||||||
p
|
p
|
||||||
nD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\armeabi-v7a\build.ninja <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<18><> <20><><EFBFBD><EFBFBD><EFBFBD>2v
|
nD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\armeabi-v7a\build.ninja <08>ȕ<EFBFBD><EFBFBD>2<18><> <20><><EFBFBD><EFBFBD><EFBFBD>2v
|
||||||
t
|
t
|
||||||
rD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\armeabi-v7a\build.ninja.txt <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2{
|
rD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\armeabi-v7a\build.ninja.txt <08>ȕ<EFBFBD><EFBFBD>2{
|
||||||
y
|
y
|
||||||
wD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\armeabi-v7a\build_file_index.txt <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2
|
wD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\armeabi-v7a\build_file_index.txt <08>ȕ<EFBFBD><EFBFBD>2
|
||||||
K <20><><EFBFBD><EFBFBD><EFBFBD>2|
|
K <20><><EFBFBD><EFBFBD><EFBFBD>2|
|
||||||
z
|
z
|
||||||
xD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\armeabi-v7a\compile_commands.json <08>ȕ<EFBFBD><C895>2 <09>
|
xD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\armeabi-v7a\compile_commands.json <08>ȕ<EFBFBD><C895>2 <09>
|
||||||
~
|
~
|
||||||
|D:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\armeabi-v7a\compile_commands.json.bin <08>ȕ<EFBFBD><C895>2
|
|D:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\armeabi-v7a\compile_commands.json.bin <08>ȕ<EFBFBD><C895>2
|
||||||
<EFBFBD>
|
<EFBFBD>
|
||||||
<EFBFBD>
|
<EFBFBD>
|
||||||
<EFBFBD>D:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\armeabi-v7a\metadata_generation_command.txt <08>ȕ<EFBFBD><C895>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2y
|
<EFBFBD>D:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\armeabi-v7a\metadata_generation_command.txt <08>ȕ<EFBFBD><C895>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2y
|
||||||
w
|
w
|
||||||
uD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\armeabi-v7a\prefab_config.json <08>ȕ<EFBFBD><C895>2
|
uD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\armeabi-v7a\prefab_config.json <08>ȕ<EFBFBD><C895>2
|
||||||
( <20><><EFBFBD><EFBFBD><EFBFBD>2~
|
( <20><><EFBFBD><EFBFBD><EFBFBD>2~
|
@ -2,27 +2,27 @@ C/C++ Structured LogO
|
|||||||
M
|
M
|
||||||
KC:\dev\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txtC
|
KC:\dev\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txtC
|
||||||
A
|
A
|
||||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2{
|
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint <08>͕<EFBFBD><EFBFBD>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2{
|
||||||
y
|
y
|
||||||
wD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86\additional_project_files.txt <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2 <20><><EFBFBD><EFBFBD><EFBFBD>2x
|
wD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86\additional_project_files.txt <08>͕<EFBFBD><EFBFBD>2 <20><><EFBFBD><EFBFBD><EFBFBD>2x
|
||||||
v
|
v
|
||||||
tD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86\android_gradle_build.json <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2}
|
tD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86\android_gradle_build.json <08>͕<EFBFBD><EFBFBD>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2}
|
||||||
{
|
{
|
||||||
yD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86\android_gradle_build_mini.json <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2j
|
yD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86\android_gradle_build_mini.json <08>͕<EFBFBD><EFBFBD>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2j
|
||||||
h
|
h
|
||||||
fD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86\build.ninja <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<18><> <20><><EFBFBD><EFBFBD><EFBFBD>2n
|
fD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86\build.ninja <08>͕<EFBFBD><EFBFBD>2<18><> <20><><EFBFBD><EFBFBD><EFBFBD>2n
|
||||||
l
|
l
|
||||||
jD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86\build.ninja.txt <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2s
|
jD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86\build.ninja.txt <08>͕<EFBFBD><EFBFBD>2s
|
||||||
q
|
q
|
||||||
oD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86\build_file_index.txt <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2
|
oD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86\build_file_index.txt <08>͕<EFBFBD><EFBFBD>2
|
||||||
K <20><><EFBFBD><EFBFBD><EFBFBD>2t
|
K <20><><EFBFBD><EFBFBD><EFBFBD>2t
|
||||||
r
|
r
|
||||||
pD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86\compile_commands.json <08>͕<EFBFBD><CD95>2 x
|
pD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86\compile_commands.json <08>͕<EFBFBD><CD95>2 x
|
||||||
v
|
v
|
||||||
tD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86\compile_commands.json.bin <08>͕<EFBFBD><CD95>2
|
tD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86\compile_commands.json.bin <08>͕<EFBFBD><CD95>2
|
||||||
~
|
~
|
||||||
|
|
|
|
||||||
zD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86\metadata_generation_command.txt <08>͕<EFBFBD><CD95>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2q
|
zD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86\metadata_generation_command.txt <08>͕<EFBFBD><CD95>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2q
|
||||||
o
|
o
|
||||||
mD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86\prefab_config.json <08>͕<EFBFBD><CD95>2
|
mD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86\prefab_config.json <08>͕<EFBFBD><CD95>2
|
||||||
( <20><><EFBFBD><EFBFBD><EFBFBD>2v
|
( <20><><EFBFBD><EFBFBD><EFBFBD>2v
|
@ -2,27 +2,27 @@ C/C++ Structured LogO
|
|||||||
M
|
M
|
||||||
KC:\dev\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txtC
|
KC:\dev\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txtC
|
||||||
A
|
A
|
||||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2~
|
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint <08>ϕ<EFBFBD><EFBFBD>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2~
|
||||||
|
|
|
|
||||||
zD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86_64\additional_project_files.txt <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2 <20><><EFBFBD><EFBFBD><EFBFBD>2{
|
zD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86_64\additional_project_files.txt <08>ϕ<EFBFBD><EFBFBD>2 <20><><EFBFBD><EFBFBD><EFBFBD>2{
|
||||||
y
|
y
|
||||||
wD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86_64\android_gradle_build.json <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD>
|
wD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86_64\android_gradle_build.json <08>ϕ<EFBFBD><EFBFBD>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD>
|
||||||
~
|
~
|
||||||
|D:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86_64\android_gradle_build_mini.json <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2m
|
|D:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86_64\android_gradle_build_mini.json <08>ϕ<EFBFBD><EFBFBD>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2m
|
||||||
k
|
k
|
||||||
iD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86_64\build.ninja <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<18><> <20><><EFBFBD><EFBFBD><EFBFBD>2q
|
iD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86_64\build.ninja <08>ϕ<EFBFBD><EFBFBD>2<18><> <20><><EFBFBD><EFBFBD><EFBFBD>2q
|
||||||
o
|
o
|
||||||
mD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86_64\build.ninja.txt <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2v
|
mD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86_64\build.ninja.txt <08>ϕ<EFBFBD><EFBFBD>2v
|
||||||
t
|
t
|
||||||
rD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86_64\build_file_index.txt <08><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2
|
rD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86_64\build_file_index.txt <08>ϕ<EFBFBD><EFBFBD>2
|
||||||
K <20><><EFBFBD><EFBFBD><EFBFBD>2w
|
K <20><><EFBFBD><EFBFBD><EFBFBD>2w
|
||||||
u
|
u
|
||||||
sD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86_64\compile_commands.json <08>ϕ<EFBFBD><CF95>2 {
|
sD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86_64\compile_commands.json <08>ϕ<EFBFBD><CF95>2 {
|
||||||
y
|
y
|
||||||
wD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86_64\compile_commands.json.bin <08>ϕ<EFBFBD><CF95>2
|
wD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86_64\compile_commands.json.bin <08>ϕ<EFBFBD><CF95>2
|
||||||
<EFBFBD>
|
<EFBFBD>
|
||||||
|
|
||||||
}D:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86_64\metadata_generation_command.txt <08>ϕ<EFBFBD><CF95>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2t
|
}D:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86_64\metadata_generation_command.txt <08>ϕ<EFBFBD><CF95>2<18> <20><><EFBFBD><EFBFBD><EFBFBD>2t
|
||||||
r
|
r
|
||||||
pD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86_64\prefab_config.json <08>ϕ<EFBFBD><CF95>2
|
pD:\KULIAH\Matkul\SKRIPSI\penyaluran_app\penyaluran_app\android\app\.cxx\Debug\626b5o2n\x86_64\prefab_config.json <08>ϕ<EFBFBD><CF95>2
|
||||||
( <20><><EFBFBD><EFBFBD><EFBFBD>2y
|
( <20><><EFBFBD><EFBFBD><EFBFBD>2y
|
@ -16,6 +16,10 @@ class PenyaluranBantuanModel {
|
|||||||
final DateTime? tanggalSelesai;
|
final DateTime? tanggalSelesai;
|
||||||
final DateTime? createdAt;
|
final DateTime? createdAt;
|
||||||
final DateTime? updatedAt;
|
final DateTime? updatedAt;
|
||||||
|
final Map<String, dynamic>? lokasiPenyaluran;
|
||||||
|
final Map<String, dynamic>? kategori;
|
||||||
|
final Map<String, dynamic>? petugas;
|
||||||
|
final int? jumlahBantuan;
|
||||||
|
|
||||||
PenyaluranBantuanModel({
|
PenyaluranBantuanModel({
|
||||||
this.id,
|
this.id,
|
||||||
@ -33,8 +37,40 @@ class PenyaluranBantuanModel {
|
|||||||
this.tanggalSelesai,
|
this.tanggalSelesai,
|
||||||
this.createdAt,
|
this.createdAt,
|
||||||
this.updatedAt,
|
this.updatedAt,
|
||||||
|
this.lokasiPenyaluran,
|
||||||
|
this.kategori,
|
||||||
|
this.petugas,
|
||||||
|
this.jumlahBantuan,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Mendapatkan nama lokasi dari relasi lokasiPenyaluran
|
||||||
|
String? get lokasiNama {
|
||||||
|
if (lokasiPenyaluran != null && lokasiPenyaluran!['nama'] != null) {
|
||||||
|
return lokasiPenyaluran!['nama'];
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mendapatkan nama kategori dari relasi kategori
|
||||||
|
String? get kategoriNama {
|
||||||
|
if (kategori != null && kategori!['nama'] != null) {
|
||||||
|
return kategori!['nama'];
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mendapatkan nama petugas dari relasi petugas
|
||||||
|
String? get namaPetugas {
|
||||||
|
if (petugas != null) {
|
||||||
|
if (petugas!['nama_lengkap'] != null) {
|
||||||
|
return petugas!['nama_lengkap'];
|
||||||
|
} else if (petugas!['nama'] != null) {
|
||||||
|
return petugas!['nama'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
factory PenyaluranBantuanModel.fromRawJson(String str) =>
|
factory PenyaluranBantuanModel.fromRawJson(String str) =>
|
||||||
PenyaluranBantuanModel.fromJson(json.decode(str));
|
PenyaluranBantuanModel.fromJson(json.decode(str));
|
||||||
|
|
||||||
@ -67,6 +103,10 @@ class PenyaluranBantuanModel {
|
|||||||
updatedAt: json["updated_at"] != null
|
updatedAt: json["updated_at"] != null
|
||||||
? DateTime.parse(json["updated_at"]).toUtc()
|
? DateTime.parse(json["updated_at"]).toUtc()
|
||||||
: null,
|
: null,
|
||||||
|
lokasiPenyaluran: json["lokasi_penyaluran"],
|
||||||
|
kategori: json["kategori"],
|
||||||
|
petugas: json["petugas"],
|
||||||
|
jumlahBantuan: json["jumlah_bantuan"],
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map<String, dynamic> toJson() => {
|
||||||
|
@ -12,6 +12,7 @@ class SkemaBantuanModel {
|
|||||||
final String? stokBantuanId;
|
final String? stokBantuanId;
|
||||||
final String? kategoriBantuanId;
|
final String? kategoriBantuanId;
|
||||||
final double? jumlahDiterimaPerOrang;
|
final double? jumlahDiterimaPerOrang;
|
||||||
|
final DateTime? batasWaktu;
|
||||||
|
|
||||||
SkemaBantuanModel({
|
SkemaBantuanModel({
|
||||||
this.id,
|
this.id,
|
||||||
@ -25,6 +26,7 @@ class SkemaBantuanModel {
|
|||||||
this.stokBantuanId,
|
this.stokBantuanId,
|
||||||
this.kategoriBantuanId,
|
this.kategoriBantuanId,
|
||||||
this.jumlahDiterimaPerOrang,
|
this.jumlahDiterimaPerOrang,
|
||||||
|
this.batasWaktu,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory SkemaBantuanModel.fromRawJson(String str) =>
|
factory SkemaBantuanModel.fromRawJson(String str) =>
|
||||||
@ -49,6 +51,9 @@ class SkemaBantuanModel {
|
|||||||
stokBantuanId: json["stok_bantuan_id"],
|
stokBantuanId: json["stok_bantuan_id"],
|
||||||
kategoriBantuanId: json["kategori_bantuan_id"],
|
kategoriBantuanId: json["kategori_bantuan_id"],
|
||||||
jumlahDiterimaPerOrang: json["jumlah_diterima_per_orang"]?.toDouble(),
|
jumlahDiterimaPerOrang: json["jumlah_diterima_per_orang"]?.toDouble(),
|
||||||
|
batasWaktu: json["batas_waktu"] != null
|
||||||
|
? DateTime.parse(json["batas_waktu"])
|
||||||
|
: null,
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map<String, dynamic> toJson() => {
|
||||||
@ -63,5 +68,6 @@ class SkemaBantuanModel {
|
|||||||
"stok_bantuan_id": stokBantuanId,
|
"stok_bantuan_id": stokBantuanId,
|
||||||
"kategori_bantuan_id": kategoriBantuanId,
|
"kategori_bantuan_id": kategoriBantuanId,
|
||||||
"jumlah_diterima_per_orang": jumlahDiterimaPerOrang,
|
"jumlah_diterima_per_orang": jumlahDiterimaPerOrang,
|
||||||
|
"batas_waktu": batasWaktu?.toIso8601String(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,9 @@ class DonaturDashboardController extends GetxController {
|
|||||||
// Indeks tab yang aktif di bottom navigation bar
|
// Indeks tab yang aktif di bottom navigation bar
|
||||||
final RxInt activeTabIndex = 0.obs;
|
final RxInt activeTabIndex = 0.obs;
|
||||||
|
|
||||||
|
// Menyimpan ID skema bantuan yang dipilih
|
||||||
|
final RxString selectedSkemaBantuanId = ''.obs;
|
||||||
|
|
||||||
// Data untuk skema bantuan tersedia
|
// Data untuk skema bantuan tersedia
|
||||||
final RxList<SkemaBantuanModel> skemaBantuan = <SkemaBantuanModel>[].obs;
|
final RxList<SkemaBantuanModel> skemaBantuan = <SkemaBantuanModel>[].obs;
|
||||||
|
|
||||||
@ -228,7 +231,8 @@ class DonaturDashboardController extends GetxController {
|
|||||||
final now = DateTime.now();
|
final now = DateTime.now();
|
||||||
final response = await _supabaseService.client
|
final response = await _supabaseService.client
|
||||||
.from('penyaluran_bantuan')
|
.from('penyaluran_bantuan')
|
||||||
.select()
|
.select(
|
||||||
|
'*, lokasi_penyaluran:lokasi_penyaluran_id(*), kategori:kategori_bantuan_id(*), petugas:petugas_id(*)')
|
||||||
.order('tanggal_penyaluran', ascending: true);
|
.order('tanggal_penyaluran', ascending: true);
|
||||||
|
|
||||||
// Konversi ke model lalu filter di sisi client
|
// Konversi ke model lalu filter di sisi client
|
||||||
@ -459,4 +463,25 @@ class DonaturDashboardController extends GetxController {
|
|||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mendapatkan nama lokasi penyaluran berdasarkan ID
|
||||||
|
Future<String?> getLokasiPenyaluran(String? lokasiId) async {
|
||||||
|
if (lokasiId == null) return null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
final response = await _supabaseService.client
|
||||||
|
.from('lokasi_penyaluran')
|
||||||
|
.select('nama')
|
||||||
|
.eq('id', lokasiId)
|
||||||
|
.single();
|
||||||
|
|
||||||
|
if (response != null && response['nama'] != null) {
|
||||||
|
return response['nama'] as String;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
} catch (e) {
|
||||||
|
print('Error fetching lokasi penyaluran: $e');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
578
lib/app/modules/donatur/views/donatur_jadwal_detail_view.dart
Normal file
578
lib/app/modules/donatur/views/donatur_jadwal_detail_view.dart
Normal file
@ -0,0 +1,578 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
import 'package:penyaluran_app/app/modules/donatur/controllers/donatur_dashboard_controller.dart';
|
||||||
|
import 'package:penyaluran_app/app/data/models/penyaluran_bantuan_model.dart';
|
||||||
|
import 'package:penyaluran_app/app/widgets/section_header.dart';
|
||||||
|
|
||||||
|
class DonaturJadwalDetailView extends GetView<DonaturDashboardController> {
|
||||||
|
const DonaturJadwalDetailView({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
DonaturDashboardController get controller {
|
||||||
|
if (!Get.isRegistered<DonaturDashboardController>(
|
||||||
|
tag: 'donatur_dashboard')) {
|
||||||
|
return Get.put(DonaturDashboardController(),
|
||||||
|
tag: 'donatur_dashboard', permanent: true);
|
||||||
|
}
|
||||||
|
return Get.find<DonaturDashboardController>(tag: 'donatur_dashboard');
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final jadwal = Get.arguments as PenyaluranBantuanModel;
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: const Text('Detail Jadwal Penyaluran'),
|
||||||
|
elevation: 0,
|
||||||
|
),
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
_buildHeaderSection(jadwal),
|
||||||
|
_buildDetailSection(jadwal),
|
||||||
|
_buildPelaksanaSection(jadwal),
|
||||||
|
_buildStatusSection(jadwal),
|
||||||
|
_buildActionSection(jadwal),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildHeaderSection(PenyaluranBantuanModel jadwal) {
|
||||||
|
String statusText = 'Akan Datang';
|
||||||
|
Color statusColor = Colors.blue;
|
||||||
|
|
||||||
|
switch (jadwal.status) {
|
||||||
|
case 'SELESAI':
|
||||||
|
statusText = 'Selesai';
|
||||||
|
statusColor = Colors.green;
|
||||||
|
break;
|
||||||
|
case 'DIBATALKAN':
|
||||||
|
statusText = 'Dibatalkan';
|
||||||
|
statusColor = Colors.red;
|
||||||
|
break;
|
||||||
|
case 'DALAM_PROSES':
|
||||||
|
statusText = 'Dalam Proses';
|
||||||
|
statusColor = Colors.orange;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
statusText = 'Akan Datang';
|
||||||
|
statusColor = Colors.blue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Container(
|
||||||
|
width: double.infinity,
|
||||||
|
padding: const EdgeInsets.all(24),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
gradient: LinearGradient(
|
||||||
|
begin: Alignment.topLeft,
|
||||||
|
end: Alignment.bottomRight,
|
||||||
|
colors: [
|
||||||
|
statusColor.withOpacity(0.8),
|
||||||
|
statusColor.withOpacity(0.5),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
_getStatusIcon(jadwal.status),
|
||||||
|
size: 16,
|
||||||
|
color: statusColor,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 6),
|
||||||
|
Text(
|
||||||
|
statusText,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: statusColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
Text(
|
||||||
|
jadwal.nama ?? 'Penyaluran Bantuan',
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 24,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
if (jadwal.tanggalPenyaluran != null)
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
const Icon(
|
||||||
|
Icons.calendar_today,
|
||||||
|
size: 16,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Text(
|
||||||
|
DateFormat('EEEE, dd MMMM yyyy', 'id_ID')
|
||||||
|
.format(jadwal.tanggalPenyaluran!),
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
color: Colors.white,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildDetailSection(PenyaluranBantuanModel jadwal) {
|
||||||
|
return Container(
|
||||||
|
padding: const EdgeInsets.all(20),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
const SectionHeader(title: 'Informasi Penyaluran'),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
_buildInfoItem(
|
||||||
|
icon: Icons.description_outlined,
|
||||||
|
title: 'Deskripsi',
|
||||||
|
value: jadwal.deskripsi ?? 'Tidak ada deskripsi',
|
||||||
|
),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
_buildInfoItem(
|
||||||
|
icon: Icons.people_outline,
|
||||||
|
title: 'Jumlah Penerima',
|
||||||
|
value: jadwal.jumlahPenerima != null
|
||||||
|
? '${jadwal.jumlahPenerima} orang'
|
||||||
|
: 'Belum ditentukan',
|
||||||
|
),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
_buildInfoItem(
|
||||||
|
icon: Icons.category_outlined,
|
||||||
|
title: 'Kategori Bantuan',
|
||||||
|
value: jadwal.kategoriNama ?? jadwal.kategoriBantuanId ?? 'Umum',
|
||||||
|
),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
_buildInfoItem(
|
||||||
|
icon: Icons.location_on_outlined,
|
||||||
|
title: 'Lokasi Penyaluran',
|
||||||
|
value: jadwal.lokasiNama ??
|
||||||
|
jadwal.lokasiPenyaluranId ??
|
||||||
|
'Belum ditentukan',
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildPelaksanaSection(PenyaluranBantuanModel jadwal) {
|
||||||
|
return Container(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 16),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
const SectionHeader(title: 'Informasi Pelaksana'),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
Card(
|
||||||
|
elevation: 0,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
side: BorderSide(color: Colors.grey.shade300),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
CircleAvatar(
|
||||||
|
radius: 25,
|
||||||
|
backgroundColor: Colors.blue.shade100,
|
||||||
|
child: Icon(
|
||||||
|
Icons.person,
|
||||||
|
color: Colors.blue.shade700,
|
||||||
|
size: 30,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 16),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
const Text(
|
||||||
|
'Petugas Pelaksana',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
Text(
|
||||||
|
jadwal.namaPetugas ??
|
||||||
|
jadwal.petugasId ??
|
||||||
|
'Belum ditugaskan',
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildStatusSection(PenyaluranBantuanModel jadwal) {
|
||||||
|
return Container(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 16),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
const SectionHeader(title: 'Status Penyaluran'),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
_buildStatusTimeline(jadwal),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildStatusTimeline(PenyaluranBantuanModel jadwal) {
|
||||||
|
final status = jadwal.status;
|
||||||
|
final bool isCompleted = status == 'SELESAI';
|
||||||
|
final bool isCancelled = status == 'DIBATALKAN';
|
||||||
|
final bool isInProgress = status == 'DALAM_PROSES';
|
||||||
|
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
_buildTimelineItem(
|
||||||
|
title: 'Dijadwalkan',
|
||||||
|
date: jadwal.createdAt != null
|
||||||
|
? DateFormat('dd MMM yyyy', 'id_ID').format(jadwal.createdAt!)
|
||||||
|
: '-',
|
||||||
|
isCompleted: true,
|
||||||
|
isFirst: true,
|
||||||
|
),
|
||||||
|
_buildTimelineItem(
|
||||||
|
title: 'Dalam Proses',
|
||||||
|
date: isInProgress || isCompleted
|
||||||
|
? jadwal.tanggalPenyaluran != null
|
||||||
|
? DateFormat('dd MMM yyyy', 'id_ID')
|
||||||
|
.format(jadwal.tanggalPenyaluran!)
|
||||||
|
: '-'
|
||||||
|
: '-',
|
||||||
|
isCompleted: isInProgress || isCompleted,
|
||||||
|
isCancelled: isCancelled,
|
||||||
|
),
|
||||||
|
_buildTimelineItem(
|
||||||
|
title: 'Selesai',
|
||||||
|
date: isCompleted
|
||||||
|
? jadwal.tanggalSelesai != null
|
||||||
|
? DateFormat('dd MMM yyyy', 'id_ID')
|
||||||
|
.format(jadwal.tanggalSelesai!)
|
||||||
|
: '-'
|
||||||
|
: '-',
|
||||||
|
isCompleted: isCompleted,
|
||||||
|
isCancelled: isCancelled,
|
||||||
|
isLast: true,
|
||||||
|
),
|
||||||
|
if (isCancelled) ...[
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.red.shade50,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
border: Border.all(color: Colors.red.shade200),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Icon(Icons.cancel, color: Colors.red.shade700, size: 20),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Text(
|
||||||
|
'Penyaluran Dibatalkan',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.red.shade700,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
Text(
|
||||||
|
'Alasan pembatalan: ${jadwal.alasanPembatalan ?? 'Tidak ada alasan yang diberikan'}',
|
||||||
|
style: TextStyle(color: Colors.red.shade700),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
if (jadwal.tanggalPembatalan != null)
|
||||||
|
Text(
|
||||||
|
'Dibatalkan pada: ${DateFormat('dd MMMM yyyy', 'id_ID').format(jadwal.tanggalPembatalan!)}',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
color: Colors.red.shade700,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildTimelineItem({
|
||||||
|
required String title,
|
||||||
|
required String date,
|
||||||
|
required bool isCompleted,
|
||||||
|
bool isFirst = false,
|
||||||
|
bool isLast = false,
|
||||||
|
bool isCancelled = false,
|
||||||
|
}) {
|
||||||
|
return Row(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
width: 20,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
if (!isFirst)
|
||||||
|
Container(
|
||||||
|
width: 2,
|
||||||
|
height: 20,
|
||||||
|
color: isCompleted
|
||||||
|
? Colors.green
|
||||||
|
: isCancelled
|
||||||
|
? Colors.red
|
||||||
|
: Colors.grey.shade300,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
color: isCompleted
|
||||||
|
? Colors.green
|
||||||
|
: isCancelled
|
||||||
|
? Colors.red
|
||||||
|
: Colors.grey.shade300,
|
||||||
|
border: Border.all(
|
||||||
|
color: isCompleted
|
||||||
|
? Colors.green
|
||||||
|
: isCancelled
|
||||||
|
? Colors.red
|
||||||
|
: Colors.grey.shade300,
|
||||||
|
width: 2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: isCompleted
|
||||||
|
? const Icon(Icons.check, size: 12, color: Colors.white)
|
||||||
|
: isCancelled
|
||||||
|
? const Icon(Icons.close, size: 12, color: Colors.white)
|
||||||
|
: null,
|
||||||
|
),
|
||||||
|
if (!isLast)
|
||||||
|
Container(
|
||||||
|
width: 2,
|
||||||
|
height: 20,
|
||||||
|
color: isCompleted && !isCancelled
|
||||||
|
? Colors.green
|
||||||
|
: Colors.grey.shade300,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 12),
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
margin: const EdgeInsets.only(bottom: 16),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
title,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: isCompleted
|
||||||
|
? Colors.black
|
||||||
|
: isCancelled
|
||||||
|
? Colors.red
|
||||||
|
: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
date,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
color: isCompleted
|
||||||
|
? Colors.grey.shade700
|
||||||
|
: isCancelled
|
||||||
|
? Colors.red.shade300
|
||||||
|
: Colors.grey.shade400,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildActionSection(PenyaluranBantuanModel jadwal) {
|
||||||
|
if (jadwal.status == 'DIBATALKAN') {
|
||||||
|
return const SizedBox.shrink();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Container(
|
||||||
|
padding: const EdgeInsets.all(20),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
const SectionHeader(title: 'Tindakan'),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: ElevatedButton.icon(
|
||||||
|
onPressed: () => _hubungiPetugas(jadwal),
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 20, vertical: 12),
|
||||||
|
backgroundColor: Colors.green,
|
||||||
|
foregroundColor: Colors.white,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
icon: const Icon(Icons.chat_outlined),
|
||||||
|
label: const Text('Hubungi Petugas'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (jadwal.status == 'SELESAI') ...[
|
||||||
|
const SizedBox(width: 12),
|
||||||
|
Expanded(
|
||||||
|
child: OutlinedButton.icon(
|
||||||
|
onPressed: () => _lihatLaporan(jadwal),
|
||||||
|
style: OutlinedButton.styleFrom(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 20, vertical: 12),
|
||||||
|
foregroundColor: Colors.blue,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
icon: const Icon(Icons.description_outlined),
|
||||||
|
label: const Text('Lihat Laporan'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildInfoItem({
|
||||||
|
required IconData icon,
|
||||||
|
required String title,
|
||||||
|
required String value,
|
||||||
|
}) {
|
||||||
|
return Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.all(8),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.blue.shade50,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
child: Icon(
|
||||||
|
icon,
|
||||||
|
size: 20,
|
||||||
|
color: Colors.blue.shade700,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 16),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
title,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
color: Colors.grey.shade600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
Text(
|
||||||
|
value,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
IconData _getStatusIcon(String? status) {
|
||||||
|
switch (status) {
|
||||||
|
case 'SELESAI':
|
||||||
|
return Icons.check_circle;
|
||||||
|
case 'DIBATALKAN':
|
||||||
|
return Icons.cancel;
|
||||||
|
case 'DALAM_PROSES':
|
||||||
|
return Icons.timelapse;
|
||||||
|
default:
|
||||||
|
return Icons.event_available;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _hubungiPetugas(PenyaluranBantuanModel jadwal) {
|
||||||
|
// Implementasi untuk menghubungi petugas
|
||||||
|
Get.snackbar(
|
||||||
|
'Fitur Belum Tersedia',
|
||||||
|
'Fitur untuk menghubungi petugas akan segera hadir',
|
||||||
|
snackPosition: SnackPosition.BOTTOM,
|
||||||
|
backgroundColor: Colors.blue.withOpacity(0.9),
|
||||||
|
colorText: Colors.white,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _lihatLaporan(PenyaluranBantuanModel jadwal) {
|
||||||
|
// Navigasi ke halaman laporan
|
||||||
|
Get.toNamed('/donatur/laporan/${jadwal.id}', arguments: jadwal);
|
||||||
|
}
|
||||||
|
}
|
@ -183,140 +183,294 @@ class DonaturJadwalView extends GetView<DonaturDashboardController> {
|
|||||||
statusColor = Colors.blue;
|
statusColor = Colors.blue;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Container(
|
return GestureDetector(
|
||||||
margin: const EdgeInsets.only(bottom: 12),
|
onTap: () => _navigateToDetail(jadwal),
|
||||||
decoration: BoxDecoration(
|
child: Container(
|
||||||
borderRadius: BorderRadius.circular(12),
|
margin: const EdgeInsets.only(bottom: 16),
|
||||||
boxShadow: [
|
decoration: BoxDecoration(
|
||||||
BoxShadow(
|
borderRadius: BorderRadius.circular(16),
|
||||||
color: Colors.black.withOpacity(0.05),
|
boxShadow: [
|
||||||
blurRadius: 10,
|
BoxShadow(
|
||||||
offset: const Offset(0, 5),
|
color: Colors.black.withOpacity(0.06),
|
||||||
),
|
blurRadius: 12,
|
||||||
],
|
offset: const Offset(0, 6),
|
||||||
),
|
),
|
||||||
child: Card(
|
],
|
||||||
elevation: 0,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(12),
|
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Card(
|
||||||
padding: const EdgeInsets.all(16),
|
elevation: 0,
|
||||||
child: Column(
|
margin: EdgeInsets.zero,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
shape: RoundedRectangleBorder(
|
||||||
children: [
|
borderRadius: BorderRadius.circular(16),
|
||||||
Row(
|
side: BorderSide(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
color: statusColor.withOpacity(0.3),
|
||||||
children: [
|
width: 1.5,
|
||||||
Container(
|
),
|
||||||
width: 50,
|
),
|
||||||
height: 50,
|
child: Padding(
|
||||||
alignment: Alignment.center,
|
padding: const EdgeInsets.all(16),
|
||||||
decoration: BoxDecoration(
|
child: Column(
|
||||||
color: statusColor.withOpacity(0.1),
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
borderRadius: BorderRadius.circular(10),
|
children: [
|
||||||
),
|
Row(
|
||||||
child: Column(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
children: [
|
||||||
children: [
|
// Tanggal dalam badge khusus
|
||||||
if (jadwal.tanggalPenyaluran != null) ...[
|
Container(
|
||||||
Text(
|
width: 58,
|
||||||
DateFormat('dd').format(jadwal.tanggalPenyaluran!),
|
height: 65,
|
||||||
style: TextStyle(
|
decoration: BoxDecoration(
|
||||||
fontSize: 18,
|
color: Colors.white,
|
||||||
fontWeight: FontWeight.bold,
|
borderRadius: BorderRadius.circular(12),
|
||||||
color: statusColor,
|
boxShadow: [
|
||||||
),
|
BoxShadow(
|
||||||
),
|
color: statusColor.withOpacity(0.2),
|
||||||
Text(
|
blurRadius: 8,
|
||||||
DateFormat('MMM', 'id_ID')
|
offset: const Offset(0, 3),
|
||||||
.format(jadwal.tanggalPenyaluran!)
|
)
|
||||||
.toUpperCase(),
|
],
|
||||||
style: TextStyle(
|
border: Border.all(
|
||||||
fontSize: 12,
|
color: statusColor.withOpacity(0.5),
|
||||||
fontWeight: FontWeight.bold,
|
width: 1.5,
|
||||||
color: statusColor,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
] else
|
|
||||||
Icon(
|
|
||||||
Icons.event,
|
|
||||||
color: statusColor,
|
|
||||||
size: 24,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 16),
|
|
||||||
Expanded(
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
jadwal.nama ?? 'Penyaluran Bantuan',
|
|
||||||
style: const TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
maxLines: 2,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
),
|
||||||
const SizedBox(height: 4),
|
),
|
||||||
Row(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Icon(
|
// Header badge
|
||||||
Icons.calendar_today,
|
Container(
|
||||||
size: 14,
|
padding: const EdgeInsets.symmetric(vertical: 3),
|
||||||
color: Colors.grey.shade600,
|
width: double.infinity,
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
const SizedBox(width: 4),
|
color: statusColor,
|
||||||
Text(
|
borderRadius: const BorderRadius.vertical(
|
||||||
formattedDate,
|
top: Radius.circular(10),
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 13,
|
|
||||||
color: Colors.grey.shade700,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
child: Text(
|
||||||
),
|
jadwal.tanggalPenyaluran != null
|
||||||
const SizedBox(height: 8),
|
? DateFormat('MMM', 'id_ID')
|
||||||
Container(
|
.format(jadwal.tanggalPenyaluran!)
|
||||||
padding: const EdgeInsets.symmetric(
|
.toUpperCase()
|
||||||
horizontal: 8, vertical: 4),
|
: 'TBD',
|
||||||
decoration: BoxDecoration(
|
style: const TextStyle(
|
||||||
color: statusColor.withOpacity(0.1),
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.circular(4),
|
fontSize: 12,
|
||||||
),
|
fontWeight: FontWeight.bold,
|
||||||
child: Text(
|
),
|
||||||
statusText,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 12,
|
|
||||||
color: statusColor,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
// Tanggal
|
||||||
],
|
Expanded(
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
jadwal.tanggalPenyaluran != null
|
||||||
|
? DateFormat('dd')
|
||||||
|
.format(jadwal.tanggalPenyaluran!)
|
||||||
|
: '-',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 24,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: statusColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
const SizedBox(width: 16),
|
||||||
|
// Informasi utama
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
jadwal.nama ?? 'Penyaluran Bantuan',
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
maxLines: 2,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 6),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Icons.calendar_today,
|
||||||
|
size: 14,
|
||||||
|
color: Colors.grey.shade600,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 6),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
formattedDate,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: Colors.grey.shade700,
|
||||||
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
if (jadwal.lokasiPenyaluranId != null) ...[
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Icons.location_on_outlined,
|
||||||
|
size: 14,
|
||||||
|
color: Colors.grey.shade600,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 6),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
jadwal.lokasiNama ??
|
||||||
|
jadwal.lokasiPenyaluranId!,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: Colors.grey.shade700,
|
||||||
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
],
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 10, vertical: 4),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: statusColor.withOpacity(0.15),
|
||||||
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
_getStatusIcon(jadwal.status),
|
||||||
|
size: 14,
|
||||||
|
color: statusColor,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 4),
|
||||||
|
Text(
|
||||||
|
statusText,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: statusColor,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
if (jadwal.deskripsi != null &&
|
||||||
|
jadwal.deskripsi!.isNotEmpty) ...[
|
||||||
|
const Divider(height: 24),
|
||||||
|
Text(
|
||||||
|
jadwal.deskripsi!,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
color: Colors.grey.shade700,
|
||||||
|
),
|
||||||
|
maxLines: 2,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
// Footer dengan informasi bantuan dan tombol detail
|
||||||
if (jadwal.deskripsi != null && jadwal.deskripsi!.isNotEmpty) ...[
|
const SizedBox(height: 16),
|
||||||
const Divider(height: 24),
|
Row(
|
||||||
Text(
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
jadwal.deskripsi!,
|
children: [
|
||||||
style: TextStyle(
|
// Informasi bantuan yang diberikan
|
||||||
fontSize: 14,
|
if (jadwal.jumlahBantuan != null) ...[
|
||||||
color: Colors.grey.shade700,
|
Row(
|
||||||
),
|
children: [
|
||||||
maxLines: 3,
|
Container(
|
||||||
overflow: TextOverflow.ellipsis,
|
padding: const EdgeInsets.all(6),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.blue.withOpacity(0.1),
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
),
|
||||||
|
child: const Icon(
|
||||||
|
Icons.volunteer_activism,
|
||||||
|
size: 14,
|
||||||
|
color: Colors.blue,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Text(
|
||||||
|
'${jadwal.jumlahBantuan} bantuan',
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
// Tombol lihat detail
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
color: Colors.grey.shade100,
|
||||||
|
),
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 12, vertical: 6),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Lihat Detail',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.grey.shade700,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 4),
|
||||||
|
Icon(
|
||||||
|
Icons.arrow_forward_ios,
|
||||||
|
size: 12,
|
||||||
|
color: Colors.grey.shade700,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IconData _getStatusIcon(String? status) {
|
||||||
|
switch (status) {
|
||||||
|
case 'SELESAI':
|
||||||
|
return Icons.check_circle;
|
||||||
|
case 'DIBATALKAN':
|
||||||
|
return Icons.cancel;
|
||||||
|
case 'DALAM_PROSES':
|
||||||
|
return Icons.timelapse;
|
||||||
|
default:
|
||||||
|
return Icons.event_available;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _navigateToDetail(dynamic jadwal) {
|
||||||
|
Get.toNamed('/donatur/jadwal/${jadwal.id}', arguments: jadwal);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,19 @@ class _FormPenitipanBantuanState extends State<FormPenitipanBantuan> {
|
|||||||
super.initState();
|
super.initState();
|
||||||
// Reset foto bantuan saat form dibuka
|
// Reset foto bantuan saat form dibuka
|
||||||
controller.resetFotoBantuan();
|
controller.resetFotoBantuan();
|
||||||
|
|
||||||
|
// Cek apakah ada skema bantuan yang dipilih dari halaman skema
|
||||||
|
if (controller.selectedSkemaBantuanId.isNotEmpty) {
|
||||||
|
// Aktifkan tab skema bantuan
|
||||||
|
setState(() {
|
||||||
|
selectedSkemaBantuanId = controller.selectedSkemaBantuanId.value;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Reset ID skema setelah digunakan
|
||||||
|
Future.delayed(Duration.zero, () {
|
||||||
|
controller.selectedSkemaBantuanId.value = '';
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -214,6 +227,96 @@ class _FormPenitipanBantuanState extends State<FormPenitipanBantuan> {
|
|||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
|
||||||
|
// Tampilkan informasi stok bantuan dari skema yang dipilih
|
||||||
|
Obx(() {
|
||||||
|
// Hanya tampilkan jika skema dipilih
|
||||||
|
if (selectedSkemaBantuanId == null ||
|
||||||
|
selectedSkemaBantuanId!.isEmpty) {
|
||||||
|
return const SizedBox.shrink();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cari skema bantuan yang dipilih
|
||||||
|
SkemaBantuanModel? selectedSkema;
|
||||||
|
try {
|
||||||
|
selectedSkema = controller.skemaBantuan.firstWhere(
|
||||||
|
(skema) => skema.id == selectedSkemaBantuanId,
|
||||||
|
);
|
||||||
|
} catch (_) {
|
||||||
|
return const SizedBox.shrink();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pastikan skema dan stok bantuan ada
|
||||||
|
if (selectedSkema.stokBantuanId == null) {
|
||||||
|
return const SizedBox.shrink();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cari stok bantuan yang sesuai
|
||||||
|
var stokBantuanFound = false;
|
||||||
|
var stokNama = 'Tidak diketahui';
|
||||||
|
var stokTotal = 0.0;
|
||||||
|
var stokSatuan = 'item';
|
||||||
|
|
||||||
|
for (var stok in controller.stokBantuan) {
|
||||||
|
if (stok.id == selectedSkema.stokBantuanId) {
|
||||||
|
stokBantuanFound = true;
|
||||||
|
stokNama = stok.nama ?? 'Tidak diketahui';
|
||||||
|
stokTotal = stok.totalStok ?? 0;
|
||||||
|
stokSatuan = stok.satuan ?? 'item';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!stokBantuanFound) {
|
||||||
|
return const SizedBox.shrink();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tampilkan informasi stok bantuan
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.all(12),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.blue.shade50,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
border: Border.all(color: Colors.blue.shade200),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Icon(Icons.info_outline,
|
||||||
|
color: Colors.blue.shade700, size: 18),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Text(
|
||||||
|
'Informasi Stok Bantuan',
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.blue.shade700,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
Text(
|
||||||
|
'Jenis Bantuan: $stokNama',
|
||||||
|
style: const TextStyle(fontSize: 14),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
Text(
|
||||||
|
'Stok Tersedia: $stokTotal $stokSatuan',
|
||||||
|
style: const TextStyle(fontSize: 14),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 16)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
] else ...[
|
] else ...[
|
||||||
// Form untuk bantuan manual
|
// Form untuk bantuan manual
|
||||||
|
@ -2,6 +2,9 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:penyaluran_app/app/modules/donatur/controllers/donatur_dashboard_controller.dart';
|
import 'package:penyaluran_app/app/modules/donatur/controllers/donatur_dashboard_controller.dart';
|
||||||
import 'package:penyaluran_app/app/widgets/section_header.dart';
|
import 'package:penyaluran_app/app/widgets/section_header.dart';
|
||||||
|
import 'package:penyaluran_app/app/data/models/stok_bantuan_model.dart';
|
||||||
|
import 'package:penyaluran_app/app/utils/format_helper.dart';
|
||||||
|
import 'package:penyaluran_app/app/utils/date_helper.dart';
|
||||||
|
|
||||||
class DonaturSkemaView extends GetView<DonaturDashboardController> {
|
class DonaturSkemaView extends GetView<DonaturDashboardController> {
|
||||||
const DonaturSkemaView({super.key});
|
const DonaturSkemaView({super.key});
|
||||||
@ -98,7 +101,7 @@ class DonaturSkemaView extends GetView<DonaturDashboardController> {
|
|||||||
color: Colors.grey.shade600,
|
color: Colors.grey.shade600,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 20),
|
||||||
...controller.skemaBantuan.map((skema) => _buildSkemaCard(skema)),
|
...controller.skemaBantuan.map((skema) => _buildSkemaCard(skema)),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
@ -106,43 +109,56 @@ class DonaturSkemaView extends GetView<DonaturDashboardController> {
|
|||||||
|
|
||||||
Widget _buildSkemaCard(dynamic skema) {
|
Widget _buildSkemaCard(dynamic skema) {
|
||||||
return Container(
|
return Container(
|
||||||
margin: const EdgeInsets.only(bottom: 16),
|
margin: const EdgeInsets.only(bottom: 20),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(16),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Colors.blue.withOpacity(0.08),
|
color: Colors.blue.withOpacity(0.1),
|
||||||
blurRadius: 10,
|
blurRadius: 12,
|
||||||
offset: const Offset(0, 4),
|
offset: const Offset(0, 5),
|
||||||
|
spreadRadius: 1,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
child: Card(
|
child: Card(
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
|
clipBehavior: Clip.antiAlias,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
side: BorderSide(
|
||||||
|
color: Colors.blue.shade100,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Column(
|
||||||
padding: const EdgeInsets.all(16),
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
child: Column(
|
children: [
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
// Header dengan warna gradient
|
||||||
children: [
|
Container(
|
||||||
Row(
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
decoration: BoxDecoration(
|
||||||
|
gradient: LinearGradient(
|
||||||
|
colors: [Colors.blue.shade600, Colors.blue.shade800],
|
||||||
|
begin: Alignment.topLeft,
|
||||||
|
end: Alignment.bottomRight,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(12),
|
padding: const EdgeInsets.all(10),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.blue.shade50,
|
color: Colors.white.withOpacity(0.2),
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(10),
|
||||||
),
|
),
|
||||||
child: Icon(
|
child: const Icon(
|
||||||
Icons.volunteer_activism,
|
Icons.volunteer_activism,
|
||||||
color: Colors.blue.shade700,
|
color: Colors.white,
|
||||||
size: 24,
|
size: 22,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 16),
|
const SizedBox(width: 12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@ -152,23 +168,28 @@ class DonaturSkemaView extends GetView<DonaturDashboardController> {
|
|||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 4),
|
if (skema.batasWaktu != null)
|
||||||
if (skema.kuota != null)
|
|
||||||
_buildInfoChip(
|
|
||||||
icon: Icons.people_outline,
|
|
||||||
label: 'Kuota: ${skema.kuota} penerima',
|
|
||||||
color: Colors.blue.shade700,
|
|
||||||
),
|
|
||||||
if (skema.jumlahDiterimaPerOrang != null)
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 4),
|
padding: const EdgeInsets.only(top: 4),
|
||||||
child: _buildInfoChip(
|
child: Row(
|
||||||
icon: Icons.inventory_2_outlined,
|
children: [
|
||||||
label:
|
const Icon(
|
||||||
'Jumlah per orang: ${skema.jumlahDiterimaPerOrang}',
|
Icons.timer_outlined,
|
||||||
color: Colors.green.shade700,
|
color: Colors.white70,
|
||||||
|
size: 14,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 4),
|
||||||
|
Text(
|
||||||
|
_formatBatasWaktu(skema.batasWaktu),
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.white70,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -176,76 +197,320 @@ class DonaturSkemaView extends GetView<DonaturDashboardController> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
),
|
||||||
if (skema.deskripsi != null && skema.deskripsi!.isNotEmpty)
|
// Konten utama
|
||||||
Column(
|
Padding(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
padding: const EdgeInsets.all(16),
|
||||||
children: [
|
child: Column(
|
||||||
Text(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
'Deskripsi',
|
children: [
|
||||||
style: TextStyle(
|
// Status batas waktu jika hampir habis (kurang dari 7 hari)
|
||||||
fontSize: 14,
|
if (skema.batasWaktu != null &&
|
||||||
fontWeight: FontWeight.bold,
|
_isDeadlineApproaching(skema.batasWaktu))
|
||||||
color: Colors.grey.shade800,
|
Container(
|
||||||
|
width: double.infinity,
|
||||||
|
margin: const EdgeInsets.only(bottom: 16),
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
vertical: 10, horizontal: 12),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.orange.shade50,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
border: Border.all(color: Colors.orange.shade200),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Icons.warning_amber_rounded,
|
||||||
|
color: Colors.orange.shade700,
|
||||||
|
size: 18,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
'Segera titipkan bantuan Anda! Batas waktu akan segera berakhir.',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.orange.shade800,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 4),
|
|
||||||
Text(
|
// Tambahkan informasi bantuan yang dibutuhkan
|
||||||
skema.deskripsi!,
|
if (skema.stokBantuanId != null)
|
||||||
style: TextStyle(
|
_buildBantuanDibutuhkan(skema.stokBantuanId!),
|
||||||
fontSize: 14,
|
|
||||||
color: Colors.grey.shade700,
|
// Informasi kuota dan jumlah per orang
|
||||||
),
|
Row(
|
||||||
),
|
children: [
|
||||||
const Divider(height: 24),
|
if (skema.kuota != null)
|
||||||
],
|
Expanded(
|
||||||
),
|
child: _buildInfoBox(
|
||||||
if (skema.kriteria != null && skema.kriteria!.isNotEmpty)
|
icon: Icons.people_outline,
|
||||||
Column(
|
title: 'Kuota',
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
value: '${skema.kuota} penerima',
|
||||||
children: [
|
color: Colors.blue.shade700,
|
||||||
Text(
|
),
|
||||||
'Kriteria Penerima',
|
),
|
||||||
style: TextStyle(
|
const SizedBox(width: 12),
|
||||||
fontSize: 14,
|
if (skema.jumlahDiterimaPerOrang != null)
|
||||||
fontWeight: FontWeight.bold,
|
Expanded(
|
||||||
color: Colors.grey.shade800,
|
child: _buildInfoBox(
|
||||||
),
|
icon: Icons.inventory_2_outlined,
|
||||||
),
|
title: 'Bantuan Per Orang',
|
||||||
const SizedBox(height: 4),
|
value: _formatJumlahPerOrang(skema.stokBantuanId,
|
||||||
Text(
|
skema.jumlahDiterimaPerOrang!),
|
||||||
skema.kriteria!,
|
color: Colors.green.shade700,
|
||||||
style: TextStyle(
|
),
|
||||||
fontSize: 14,
|
),
|
||||||
color: Colors.grey.shade700,
|
],
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 16),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
ElevatedButton.icon(
|
|
||||||
onPressed: () {
|
|
||||||
// Navigasi ke formulir penitipan bantuan
|
|
||||||
controller.activeTabIndex.value = 3;
|
|
||||||
},
|
|
||||||
icon: const Icon(Icons.add_box_outlined, size: 18),
|
|
||||||
label: const Text('Titipkan Bantuan'),
|
|
||||||
style: ElevatedButton.styleFrom(
|
|
||||||
foregroundColor: Colors.white,
|
|
||||||
backgroundColor: Colors.green.shade600,
|
|
||||||
minimumSize: const Size(double.infinity, 45),
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
),
|
||||||
|
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
// Tombol titipkan bantuan
|
||||||
|
ElevatedButton.icon(
|
||||||
|
onPressed: () {
|
||||||
|
// Menyimpan ID skema bantuan yang dipilih
|
||||||
|
if (skema.id != null) {
|
||||||
|
controller.selectedSkemaBantuanId.value = skema.id!;
|
||||||
|
}
|
||||||
|
// Beralih ke tab penitipan bantuan
|
||||||
|
controller.activeTabIndex.value = 3;
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.add_box_outlined, size: 18),
|
||||||
|
label: const Text('Titipkan Bantuan'),
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
foregroundColor: Colors.white,
|
||||||
|
backgroundColor: Colors.green.shade600,
|
||||||
|
minimumSize: const Size(double.infinity, 48),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
elevation: 0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildBantuanDibutuhkan(String stokBantuanId) {
|
||||||
|
// Cari stok bantuan yang sesuai dengan ID di skema
|
||||||
|
final stokBantuan = controller.stokBantuan.firstWhere(
|
||||||
|
(stok) => stok.id == stokBantuanId,
|
||||||
|
orElse: () => StokBantuanModel(),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (stokBantuan.id == null) return const SizedBox.shrink();
|
||||||
|
|
||||||
|
return Container(
|
||||||
|
width: double.infinity,
|
||||||
|
margin: const EdgeInsets.only(bottom: 16),
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.green.shade50,
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
border: Border.all(color: Colors.green.shade200),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Icons.inventory_2,
|
||||||
|
color: Colors.green.shade700,
|
||||||
|
size: 18,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Text(
|
||||||
|
'Bantuan yang Dibutuhkan',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.green.shade800,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: 12),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
stokBantuan.nama ?? 'Tidak tersedia',
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (stokBantuan.kategoriBantuan != null)
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 4),
|
||||||
|
child: Text(
|
||||||
|
'Kategori: ${stokBantuan.kategoriBantuan!['nama'] ?? 'Umum'}',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.grey.shade700,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.green.shade100,
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Icons.inventory_rounded,
|
||||||
|
size: 16,
|
||||||
|
color: Colors.green.shade700,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 4),
|
||||||
|
Text(
|
||||||
|
stokBantuan.isUang == true
|
||||||
|
? 'Stok: ${_formatRupiah(stokBantuan.totalStok)}'
|
||||||
|
: 'Stok: ${stokBantuan.totalStok?.toStringAsFixed(0) ?? '0'} ${stokBantuan.satuan ?? ''}',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.green.shade800,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
if (stokBantuan.deskripsi != null &&
|
||||||
|
stokBantuan.deskripsi!.isNotEmpty)
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 8),
|
||||||
|
child: Text(
|
||||||
|
stokBantuan.deskripsi!,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: Colors.grey.shade700,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _buildInfoBox({
|
||||||
|
required IconData icon,
|
||||||
|
required String title,
|
||||||
|
required String value,
|
||||||
|
required Color color,
|
||||||
|
}) {
|
||||||
|
return Container(
|
||||||
|
padding: const EdgeInsets.all(12),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: color.withOpacity(0.1),
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
border: Border.all(color: color.withOpacity(0.2)),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
icon,
|
||||||
|
size: 16,
|
||||||
|
color: color,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 6),
|
||||||
|
Text(
|
||||||
|
title,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: color,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 6),
|
||||||
|
Text(
|
||||||
|
value,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
color: Colors.grey.shade800,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildInfoSection({
|
||||||
|
required String title,
|
||||||
|
required String content,
|
||||||
|
required IconData icon,
|
||||||
|
}) {
|
||||||
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
icon,
|
||||||
|
size: 16,
|
||||||
|
color: Colors.grey.shade700,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 6),
|
||||||
|
Text(
|
||||||
|
title,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.grey.shade800,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.all(12),
|
||||||
|
width: double.infinity,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.grey.shade50,
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
border: Border.all(color: Colors.grey.shade200),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
content,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
color: Colors.grey.shade700,
|
||||||
|
height: 1.4,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Widget _buildInfoChip({
|
Widget _buildInfoChip({
|
||||||
required IconData icon,
|
required IconData icon,
|
||||||
required String label,
|
required String label,
|
||||||
@ -270,4 +535,87 @@ class DonaturSkemaView extends GetView<DonaturDashboardController> {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fungsi untuk memformat tanggal batas waktu
|
||||||
|
String _formatBatasWaktu(DateTime? batasWaktu) {
|
||||||
|
if (batasWaktu == null) return '';
|
||||||
|
|
||||||
|
DateTime now = DateTime.now();
|
||||||
|
Duration difference = batasWaktu.difference(now);
|
||||||
|
|
||||||
|
if (difference.isNegative) {
|
||||||
|
return 'Batas waktu telah berakhir';
|
||||||
|
}
|
||||||
|
|
||||||
|
int days = difference.inDays;
|
||||||
|
if (days > 0) {
|
||||||
|
return 'Batas waktu: ${days} hari lagi';
|
||||||
|
} else {
|
||||||
|
int hours = difference.inHours;
|
||||||
|
if (hours > 0) {
|
||||||
|
return 'Batas waktu: ${hours} jam lagi';
|
||||||
|
} else {
|
||||||
|
int minutes = difference.inMinutes;
|
||||||
|
return 'Batas waktu: ${minutes} menit lagi';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cek apakah deadline mendekati (kurang dari 7 hari)
|
||||||
|
bool _isDeadlineApproaching(DateTime? batasWaktu) {
|
||||||
|
if (batasWaktu == null) return false;
|
||||||
|
|
||||||
|
DateTime now = DateTime.now();
|
||||||
|
Duration difference = batasWaktu.difference(now);
|
||||||
|
|
||||||
|
return difference.inDays < 7 && !difference.isNegative;
|
||||||
|
}
|
||||||
|
|
||||||
|
String _formatJumlahPerOrang(
|
||||||
|
String? stokBantuanId, dynamic jumlahDiterimaPerOrang) {
|
||||||
|
// Jika stokBantuanId null, kembalikan nilai apa adanya
|
||||||
|
if (stokBantuanId == null) return jumlahDiterimaPerOrang.toString();
|
||||||
|
|
||||||
|
// Cari stok bantuan berdasarkan ID
|
||||||
|
final stokBantuan = controller.stokBantuan.firstWhere(
|
||||||
|
(stok) => stok.id == stokBantuanId,
|
||||||
|
orElse: () => StokBantuanModel(),
|
||||||
|
);
|
||||||
|
|
||||||
|
// Jika nilai bantuan berupa uang, format sebagai Rupiah
|
||||||
|
if (stokBantuan.isUang == true) {
|
||||||
|
double nilai = 0;
|
||||||
|
if (jumlahDiterimaPerOrang is int) {
|
||||||
|
nilai = jumlahDiterimaPerOrang.toDouble();
|
||||||
|
} else if (jumlahDiterimaPerOrang is double) {
|
||||||
|
nilai = jumlahDiterimaPerOrang;
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
nilai = double.parse(jumlahDiterimaPerOrang.toString());
|
||||||
|
} catch (e) {
|
||||||
|
return jumlahDiterimaPerOrang.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Format nilai sebagai Rupiah menggunakan DateHelper
|
||||||
|
return DateHelper.formatRupiah(nilai);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Jika bukan uang, kembalikan nilai + satuan (jika ada)
|
||||||
|
return '${jumlahDiterimaPerOrang} ${stokBantuan.satuan ?? ''}';
|
||||||
|
}
|
||||||
|
|
||||||
|
String _formatRupiah(dynamic amount) {
|
||||||
|
if (amount is num) {
|
||||||
|
return DateHelper.formatRupiah(amount);
|
||||||
|
} else if (amount is String) {
|
||||||
|
try {
|
||||||
|
double nilai = double.parse(amount);
|
||||||
|
return DateHelper.formatRupiah(nilai);
|
||||||
|
} catch (e) {
|
||||||
|
return 'Rp ${amount.replaceAllMapped(RegExp(r'(\d{1,3})(?=(\d{3})+(?!\d))'), (Match m) => '${m[1]}.')}';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return 'Rp 0';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ import 'package:open_file/open_file.dart';
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
import 'package:penyaluran_app/app/utils/format_helper.dart';
|
||||||
|
|
||||||
class LaporanPenyaluranController extends GetxController {
|
class LaporanPenyaluranController extends GetxController {
|
||||||
final AuthController _authController = Get.find<AuthController>();
|
final AuthController _authController = Get.find<AuthController>();
|
||||||
|
@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:penyaluran_app/app/modules/laporan_penyaluran/controllers/laporan_penyaluran_controller.dart';
|
import 'package:penyaluran_app/app/modules/laporan_penyaluran/controllers/laporan_penyaluran_controller.dart';
|
||||||
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
||||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
import 'package:penyaluran_app/app/utils/format_helper.dart';
|
||||||
import 'package:penyaluran_app/app/widgets/custom_app_bar.dart';
|
import 'package:penyaluran_app/app/widgets/custom_app_bar.dart';
|
||||||
import 'package:penyaluran_app/app/widgets/section_header.dart';
|
import 'package:penyaluran_app/app/widgets/section_header.dart';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
@ -370,6 +370,9 @@ class LaporanPenyaluranCreateView extends GetView<LaporanPenyaluranController> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
controller.saveLaporan(penyaluranId);
|
controller.saveLaporan(penyaluranId);
|
||||||
|
//kembali reload halaman
|
||||||
|
// Kembali dan reload halaman setelah menyimpan laporan
|
||||||
|
Get.back(result: true);
|
||||||
},
|
},
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: AppTheme.primaryColor,
|
backgroundColor: AppTheme.primaryColor,
|
||||||
|
@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:penyaluran_app/app/modules/laporan_penyaluran/controllers/laporan_penyaluran_controller.dart';
|
import 'package:penyaluran_app/app/modules/laporan_penyaluran/controllers/laporan_penyaluran_controller.dart';
|
||||||
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
||||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
import 'package:penyaluran_app/app/utils/format_helper.dart';
|
||||||
import 'package:penyaluran_app/app/widgets/custom_app_bar.dart';
|
import 'package:penyaluran_app/app/widgets/custom_app_bar.dart';
|
||||||
import 'package:penyaluran_app/app/widgets/section_header.dart';
|
import 'package:penyaluran_app/app/widgets/section_header.dart';
|
||||||
import 'package:penyaluran_app/app/widgets/status_badge.dart';
|
import 'package:penyaluran_app/app/widgets/status_badge.dart';
|
||||||
|
@ -3,9 +3,8 @@ import 'package:get/get.dart';
|
|||||||
import 'package:penyaluran_app/app/data/models/laporan_penyaluran_model.dart';
|
import 'package:penyaluran_app/app/data/models/laporan_penyaluran_model.dart';
|
||||||
import 'package:penyaluran_app/app/modules/laporan_penyaluran/controllers/laporan_penyaluran_controller.dart';
|
import 'package:penyaluran_app/app/modules/laporan_penyaluran/controllers/laporan_penyaluran_controller.dart';
|
||||||
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
||||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
import 'package:penyaluran_app/app/utils/format_helper.dart';
|
||||||
import 'package:penyaluran_app/app/widgets/custom_app_bar.dart';
|
import 'package:penyaluran_app/app/widgets/custom_app_bar.dart';
|
||||||
import 'package:penyaluran_app/app/widgets/section_header.dart';
|
|
||||||
import 'package:penyaluran_app/app/widgets/status_badge.dart';
|
import 'package:penyaluran_app/app/widgets/status_badge.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
@ -34,36 +33,58 @@ class LaporanPenyaluranView extends GetView<LaporanPenyaluranController> {
|
|||||||
|
|
||||||
if (controller.daftarLaporan.isEmpty) {
|
if (controller.daftarLaporan.isEmpty) {
|
||||||
return Center(
|
return Center(
|
||||||
child: Column(
|
child: Padding(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
padding: const EdgeInsets.all(24.0),
|
||||||
children: [
|
child: Column(
|
||||||
const Icon(Icons.note_alt_outlined,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
size: 64, color: Colors.grey),
|
children: [
|
||||||
const SizedBox(height: 16),
|
Container(
|
||||||
const Text(
|
padding: const EdgeInsets.all(16),
|
||||||
'Belum ada laporan penyaluran',
|
decoration: BoxDecoration(
|
||||||
style: TextStyle(
|
color: Colors.blue.shade50,
|
||||||
fontSize: 16,
|
shape: BoxShape.circle,
|
||||||
fontWeight: FontWeight.bold,
|
),
|
||||||
|
child: Icon(
|
||||||
|
Icons.description_outlined,
|
||||||
|
size: 72,
|
||||||
|
color: AppTheme.primaryColor,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: 24),
|
||||||
const SizedBox(height: 8),
|
const Text(
|
||||||
const Text(
|
'Belum Ada Laporan Penyaluran',
|
||||||
'Buat laporan baru untuk penyaluran yang telah selesai',
|
style: TextStyle(
|
||||||
textAlign: TextAlign.center,
|
fontSize: 18,
|
||||||
style: TextStyle(color: Colors.grey),
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 24),
|
|
||||||
ElevatedButton.icon(
|
|
||||||
onPressed: () => _showPenyaluranDialog(context),
|
|
||||||
icon: const Icon(Icons.add),
|
|
||||||
label: const Text('Buat Laporan Baru'),
|
|
||||||
style: ElevatedButton.styleFrom(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 24, vertical: 12),
|
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: 12),
|
||||||
],
|
const Text(
|
||||||
|
'Buat laporan baru untuk penyaluran bantuan yang telah selesai',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
color: Colors.grey,
|
||||||
|
height: 1.5,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 32),
|
||||||
|
ElevatedButton.icon(
|
||||||
|
onPressed: () => _showPenyaluranDialog(context),
|
||||||
|
icon: const Icon(Icons.add),
|
||||||
|
label: const Text('Buat Laporan Baru'),
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
backgroundColor: AppTheme.primaryColor,
|
||||||
|
foregroundColor: Colors.white,
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 24, vertical: 12),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -110,24 +131,42 @@ class LaporanPenyaluranView extends GetView<LaporanPenyaluranController> {
|
|||||||
// Widget untuk filter status
|
// Widget untuk filter status
|
||||||
Widget _buildStatusFilter() {
|
Widget _buildStatusFilter() {
|
||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||||
color: AppTheme.primaryColor.withOpacity(0.05),
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.grey.withOpacity(0.1),
|
||||||
|
spreadRadius: 1,
|
||||||
|
blurRadius: 3,
|
||||||
|
offset: const Offset(0, 2),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
const SectionHeader(
|
Row(
|
||||||
title: 'Filter Status',
|
children: [
|
||||||
// subtitle: 'Tampilkan laporan berdasarkan status',
|
Icon(Icons.filter_list, color: AppTheme.primaryColor),
|
||||||
// showDivider: false,
|
const SizedBox(width: 8),
|
||||||
|
const Text(
|
||||||
|
'Filter Status Laporan',
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 16,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 12),
|
||||||
SingleChildScrollView(
|
SingleChildScrollView(
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
_buildFilterChip('SEMUA'),
|
_buildFilterChip('SEMUA', Icons.list_alt),
|
||||||
_buildFilterChip('DRAFT'),
|
_buildFilterChip('DRAFT', Icons.edit_note),
|
||||||
_buildFilterChip('FINAL'),
|
_buildFilterChip('FINAL', Icons.check_circle),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -137,23 +176,42 @@ class LaporanPenyaluranView extends GetView<LaporanPenyaluranController> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Chip untuk filter
|
// Chip untuk filter
|
||||||
Widget _buildFilterChip(String status) {
|
Widget _buildFilterChip(String status, IconData icon) {
|
||||||
return Obx(() {
|
return Obx(() {
|
||||||
final isSelected = controller.filterStatus.value == status;
|
final isSelected = controller.filterStatus.value == status;
|
||||||
return Padding(
|
return Container(
|
||||||
padding: const EdgeInsets.only(right: 8),
|
margin: const EdgeInsets.only(right: 12),
|
||||||
child: FilterChip(
|
child: Material(
|
||||||
selected: isSelected,
|
elevation: isSelected ? 2 : 0,
|
||||||
label: Text(status),
|
borderRadius: BorderRadius.circular(25),
|
||||||
onSelected: (_) {
|
color: isSelected ? AppTheme.primaryColor : Colors.grey.shade100,
|
||||||
controller.filterStatus.value = status;
|
child: InkWell(
|
||||||
},
|
onTap: () {
|
||||||
backgroundColor: Colors.white,
|
controller.filterStatus.value = status;
|
||||||
checkmarkColor: Colors.white,
|
},
|
||||||
selectedColor: AppTheme.primaryColor,
|
borderRadius: BorderRadius.circular(25),
|
||||||
labelStyle: TextStyle(
|
child: Padding(
|
||||||
color: isSelected ? Colors.white : Colors.black,
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||||
fontWeight: isSelected ? FontWeight.bold : FontWeight.normal,
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
icon,
|
||||||
|
size: 16,
|
||||||
|
color: isSelected ? Colors.white : Colors.black54,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 6),
|
||||||
|
Text(
|
||||||
|
status,
|
||||||
|
style: TextStyle(
|
||||||
|
color: isSelected ? Colors.white : Colors.black87,
|
||||||
|
fontWeight:
|
||||||
|
isSelected ? FontWeight.bold : FontWeight.normal,
|
||||||
|
fontSize: 13,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -165,71 +223,77 @@ class LaporanPenyaluranView extends GetView<LaporanPenyaluranController> {
|
|||||||
BuildContext context, LaporanPenyaluranModel laporan) {
|
BuildContext context, LaporanPenyaluranModel laporan) {
|
||||||
return Card(
|
return Card(
|
||||||
margin: const EdgeInsets.only(bottom: 16),
|
margin: const EdgeInsets.only(bottom: 16),
|
||||||
elevation: 3,
|
elevation: 2,
|
||||||
|
clipBehavior: Clip.antiAlias,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(16),
|
||||||
),
|
),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.toNamed('/laporan-penyaluran/detail', arguments: laporan.id);
|
Get.toNamed('/laporan-penyaluran/detail', arguments: laporan.id);
|
||||||
},
|
},
|
||||||
borderRadius: BorderRadius.circular(12),
|
child: Column(
|
||||||
child: Container(
|
children: [
|
||||||
decoration: BoxDecoration(
|
// Header dengan status
|
||||||
borderRadius: BorderRadius.circular(12),
|
Container(
|
||||||
gradient: AppTheme.primaryGradient,
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
child: Padding(
|
gradient: AppTheme.primaryGradient,
|
||||||
padding: const EdgeInsets.all(16),
|
),
|
||||||
child: Column(
|
child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Expanded(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
child: Text(
|
||||||
children: [
|
laporan.judul,
|
||||||
Expanded(
|
style: const TextStyle(
|
||||||
child: Text(
|
fontWeight: FontWeight.bold,
|
||||||
laporan.judul,
|
fontSize: 16,
|
||||||
style: const TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 16,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
maxLines: 2,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
StatusBadge(status: laporan.status ?? 'DRAFT'),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const Divider(height: 24, color: Colors.white30),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Icon(
|
|
||||||
Icons.calendar_today,
|
|
||||||
size: 16,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 6),
|
|
||||||
Text(
|
|
||||||
'Tanggal: ${laporan.tanggalLaporan != null ? DateTimeHelper.formatDateTime(laporan.tanggalLaporan!) : '-'}',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 12,
|
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
|
maxLines: 2,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
const SizedBox(width: 8),
|
||||||
const SizedBox(height: 16),
|
StatusBadge(status: laporan.status ?? 'DRAFT'),
|
||||||
Row(
|
],
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
),
|
||||||
children: [
|
),
|
||||||
if (laporan.status == 'FINAL')
|
// Body with details
|
||||||
Material(
|
Container(
|
||||||
color: Colors.white.withOpacity(0.2),
|
padding: const EdgeInsets.all(16),
|
||||||
borderRadius: BorderRadius.circular(8),
|
child: Column(
|
||||||
child: InkWell(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
borderRadius: BorderRadius.circular(8),
|
children: [
|
||||||
|
// Informasi dengan icon
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
_buildInfoItem(
|
||||||
|
Icons.calendar_today,
|
||||||
|
'Tanggal',
|
||||||
|
laporan.tanggalLaporan != null
|
||||||
|
? DateTimeHelper.formatDateTime(
|
||||||
|
laporan.tanggalLaporan!)
|
||||||
|
: '-',
|
||||||
|
),
|
||||||
|
_buildInfoItem(
|
||||||
|
Icons.description,
|
||||||
|
'Status',
|
||||||
|
laporan.status ?? 'DRAFT',
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
// Action buttons
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
if (laporan.status == 'FINAL')
|
||||||
|
_buildActionButton(
|
||||||
|
icon: Icons.picture_as_pdf,
|
||||||
|
label: 'Ekspor PDF',
|
||||||
|
color: Colors.blue,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
controller
|
controller
|
||||||
.fetchPenyaluranDetail(
|
.fetchPenyaluranDetail(
|
||||||
@ -241,85 +305,104 @@ class LaporanPenyaluranView extends GetView<LaporanPenyaluranController> {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 12, vertical: 6),
|
|
||||||
child: Row(
|
|
||||||
children: const [
|
|
||||||
Icon(
|
|
||||||
Icons.picture_as_pdf,
|
|
||||||
size: 16,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
SizedBox(width: 4),
|
|
||||||
Text(
|
|
||||||
'Ekspor PDF',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 12,
|
|
||||||
color: Colors.white,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(width: 8),
|
||||||
const SizedBox(width: 8),
|
_buildActionButton(
|
||||||
Material(
|
icon: Icons.edit,
|
||||||
color: Colors.orange.shade50,
|
label: 'Edit',
|
||||||
borderRadius: BorderRadius.circular(8),
|
color: Colors.orange,
|
||||||
child: InkWell(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.toNamed('/laporan-penyaluran/edit',
|
Get.toNamed('/laporan-penyaluran/edit',
|
||||||
arguments: laporan.id);
|
arguments: laporan.id);
|
||||||
},
|
},
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 12, vertical: 6),
|
|
||||||
child: Row(
|
|
||||||
children: const [
|
|
||||||
Icon(Icons.edit, color: Colors.orange, size: 16),
|
|
||||||
SizedBox(width: 4),
|
|
||||||
Text('Edit',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.orange,
|
|
||||||
fontWeight: FontWeight.bold)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(width: 8),
|
||||||
const SizedBox(width: 8),
|
_buildActionButton(
|
||||||
Material(
|
icon: Icons.delete,
|
||||||
color: Colors.red.shade50,
|
label: 'Hapus',
|
||||||
borderRadius: BorderRadius.circular(8),
|
color: Colors.red,
|
||||||
child: InkWell(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
_showDeleteConfirmation(context, laporan.id!);
|
_showDeleteConfirmation(context, laporan.id!);
|
||||||
},
|
},
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 12, vertical: 6),
|
|
||||||
child: Row(
|
|
||||||
children: const [
|
|
||||||
Icon(Icons.delete, color: Colors.red, size: 16),
|
|
||||||
SizedBox(width: 4),
|
|
||||||
Text('Hapus',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.red,
|
|
||||||
fontWeight: FontWeight.bold)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper untuk item informasi
|
||||||
|
Widget _buildInfoItem(IconData icon, String label, String value) {
|
||||||
|
return Expanded(
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.all(8),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.grey.shade50,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Icon(icon, size: 16, color: AppTheme.primaryColor),
|
||||||
|
const SizedBox(width: 6),
|
||||||
|
Text(
|
||||||
|
label,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.grey.shade700,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
Text(
|
||||||
|
value,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 13,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper untuk tombol aksi
|
||||||
|
Widget _buildActionButton({
|
||||||
|
required IconData icon,
|
||||||
|
required String label,
|
||||||
|
required Color color,
|
||||||
|
required VoidCallback onTap,
|
||||||
|
}) {
|
||||||
|
return Material(
|
||||||
|
color: color.withOpacity(0.1),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
child: InkWell(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
onTap: onTap,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Icon(icon, color: color, size: 16),
|
||||||
|
const SizedBox(width: 4),
|
||||||
|
Text(
|
||||||
|
label,
|
||||||
|
style: TextStyle(
|
||||||
|
color: color,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 12,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -332,19 +415,42 @@ class LaporanPenyaluranView extends GetView<LaporanPenyaluranController> {
|
|||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: const Text('Hapus Laporan'),
|
shape: RoundedRectangleBorder(
|
||||||
content: const Text('Apakah Anda yakin ingin menghapus laporan ini?'),
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
),
|
||||||
|
title: Row(
|
||||||
|
children: [
|
||||||
|
Icon(Icons.warning_amber_rounded, color: Colors.red, size: 24),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
const Text('Hapus Laporan'),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
content: const Text(
|
||||||
|
'Apakah Anda yakin ingin menghapus laporan ini? Tindakan ini tidak dapat dibatalkan.',
|
||||||
|
style: TextStyle(height: 1.5),
|
||||||
|
),
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
child: const Text('Batal'),
|
child: const Text('Batal'),
|
||||||
),
|
),
|
||||||
TextButton(
|
ElevatedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
controller.deleteLaporan(laporanId);
|
controller.deleteLaporan(laporanId).then((_) {
|
||||||
|
Get.snackbar(
|
||||||
|
'Berhasil',
|
||||||
|
'Laporan berhasil dihapus',
|
||||||
|
snackPosition: SnackPosition.BOTTOM,
|
||||||
|
backgroundColor: Colors.green,
|
||||||
|
colorText: Colors.white,
|
||||||
|
);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
style: TextButton.styleFrom(foregroundColor: Colors.red),
|
style: ElevatedButton.styleFrom(
|
||||||
|
backgroundColor: Colors.red,
|
||||||
|
foregroundColor: Colors.white,
|
||||||
|
),
|
||||||
child: const Text('Hapus'),
|
child: const Text('Hapus'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -370,31 +476,90 @@ class LaporanPenyaluranView extends GetView<LaporanPenyaluranController> {
|
|||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: const Text('Pilih Penyaluran'),
|
title: Row(
|
||||||
|
children: [
|
||||||
|
Icon(Icons.assignment, color: AppTheme.primaryColor),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
const Text('Pilih Penyaluran'),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
),
|
||||||
|
contentPadding: const EdgeInsets.only(top: 16, left: 24, right: 24),
|
||||||
content: SizedBox(
|
content: SizedBox(
|
||||||
width: double.maxFinite,
|
width: double.maxFinite,
|
||||||
child: ListView.builder(
|
child: Column(
|
||||||
shrinkWrap: true,
|
mainAxisSize: MainAxisSize.min,
|
||||||
itemCount: controller.penyaluranTanpaLaporan.length,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
itemBuilder: (context, index) {
|
children: [
|
||||||
final penyaluran = controller.penyaluranTanpaLaporan[index];
|
Text(
|
||||||
return ListTile(
|
'Pilih salah satu penyaluran bantuan yang akan dibuat laporannya:',
|
||||||
title: Text(
|
style: TextStyle(color: Colors.grey.shade700, fontSize: 13),
|
||||||
penyaluran.nama ??
|
),
|
||||||
'Penyaluran #${penyaluran.id?.substring(0, 8)}',
|
const SizedBox(height: 8),
|
||||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
Container(
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
maxHeight: MediaQuery.of(context).size.height * 0.4,
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
child: ListView.separated(
|
||||||
'Tanggal: ${penyaluran.tanggalSelesai != null ? DateFormat('dd/MM/yyyy').format(penyaluran.tanggalSelesai!) : '-'}',
|
shrinkWrap: true,
|
||||||
|
itemCount: controller.penyaluranTanpaLaporan.length,
|
||||||
|
separatorBuilder: (context, index) =>
|
||||||
|
const Divider(height: 1),
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final penyaluran =
|
||||||
|
controller.penyaluranTanpaLaporan[index];
|
||||||
|
return ListTile(
|
||||||
|
contentPadding: const EdgeInsets.symmetric(
|
||||||
|
vertical: 6,
|
||||||
|
horizontal: 8,
|
||||||
|
),
|
||||||
|
leading: CircleAvatar(
|
||||||
|
backgroundColor:
|
||||||
|
AppTheme.primaryColor.withOpacity(0.2),
|
||||||
|
child: const Icon(
|
||||||
|
Icons.inventory_2,
|
||||||
|
color: AppTheme.primaryColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
title: Text(
|
||||||
|
penyaluran.nama ??
|
||||||
|
'Penyaluran #${penyaluran.id?.substring(0, 8)}',
|
||||||
|
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
subtitle: Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Icons.calendar_today,
|
||||||
|
size: 12,
|
||||||
|
color: Colors.grey.shade600,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 4),
|
||||||
|
Text(
|
||||||
|
penyaluran.tanggalSelesai != null
|
||||||
|
? DateFormat('dd/MM/yyyy')
|
||||||
|
.format(penyaluran.tanggalSelesai!)
|
||||||
|
: '-',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.grey.shade600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
trailing: const Icon(Icons.arrow_forward_ios, size: 16),
|
||||||
|
onTap: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
// Arahkan ke halaman buat laporan dengan ID penyaluran
|
||||||
|
Get.toNamed('/laporan-penyaluran/create',
|
||||||
|
arguments: penyaluran.id);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
onTap: () {
|
),
|
||||||
Navigator.of(context).pop();
|
],
|
||||||
// Arahkan ke halaman buat laporan dengan ID penyaluran
|
|
||||||
Get.toNamed('/laporan-penyaluran/create',
|
|
||||||
arguments: penyaluran.id);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
|
@ -4,7 +4,7 @@ import 'package:syncfusion_flutter_calendar/calendar.dart';
|
|||||||
import 'package:penyaluran_app/app/data/models/penyaluran_bantuan_model.dart';
|
import 'package:penyaluran_app/app/data/models/penyaluran_bantuan_model.dart';
|
||||||
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/jadwal_penyaluran_controller.dart';
|
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/jadwal_penyaluran_controller.dart';
|
||||||
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
||||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
import 'package:penyaluran_app/app/utils/format_helper.dart';
|
||||||
|
|
||||||
class CalendarViewWidget extends StatelessWidget {
|
class CalendarViewWidget extends StatelessWidget {
|
||||||
final JadwalPenyaluranController controller;
|
final JadwalPenyaluranController controller;
|
||||||
@ -25,30 +25,48 @@ class CalendarViewWidget extends StatelessWidget {
|
|||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(16),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Colors.grey.withOpacity(0.1),
|
color: Colors.grey.withOpacity(0.1),
|
||||||
spreadRadius: 1,
|
spreadRadius: 1,
|
||||||
blurRadius: 3,
|
blurRadius: 5,
|
||||||
offset: const Offset(0, 1),
|
offset: const Offset(0, 2),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Container(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
child: Text(
|
decoration: BoxDecoration(
|
||||||
'Kalender Penyaluran Bulan Ini',
|
gradient: AppTheme.primaryGradient,
|
||||||
style: Theme.of(context).textTheme.titleLarge?.copyWith(
|
borderRadius: const BorderRadius.only(
|
||||||
fontWeight: FontWeight.bold,
|
topLeft: Radius.circular(16),
|
||||||
),
|
topRight: Radius.circular(16),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
const Icon(
|
||||||
|
Icons.calendar_month_rounded,
|
||||||
|
color: Colors.white,
|
||||||
|
size: 28,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 12),
|
||||||
|
Text(
|
||||||
|
'Kalender Penyaluran',
|
||||||
|
style: Theme.of(context).textTheme.titleLarge?.copyWith(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(12.0),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: MediaQuery.of(context).size.height * 0.65,
|
height: MediaQuery.of(context).size.height * 0.65,
|
||||||
child: Obx(() {
|
child: Obx(() {
|
||||||
@ -64,7 +82,7 @@ class CalendarViewWidget extends StatelessWidget {
|
|||||||
MonthAppointmentDisplayMode.indicator,
|
MonthAppointmentDisplayMode.indicator,
|
||||||
showAgenda: true,
|
showAgenda: true,
|
||||||
agendaViewHeight: MediaQuery.of(context).size.height * 0.3,
|
agendaViewHeight: MediaQuery.of(context).size.height * 0.3,
|
||||||
agendaItemHeight: 60,
|
agendaItemHeight: 70,
|
||||||
dayFormat: 'EEE',
|
dayFormat: 'EEE',
|
||||||
numberOfWeeksInView: 6,
|
numberOfWeeksInView: 6,
|
||||||
appointmentDisplayCount: 3,
|
appointmentDisplayCount: 3,
|
||||||
@ -82,19 +100,19 @@ class CalendarViewWidget extends StatelessWidget {
|
|||||||
color: Colors.grey.withOpacity(0.7),
|
color: Colors.grey.withOpacity(0.7),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
agendaStyle: const AgendaStyle(
|
agendaStyle: AgendaStyle(
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.grey.shade50,
|
||||||
appointmentTextStyle: TextStyle(
|
appointmentTextStyle: const TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
dateTextStyle: TextStyle(
|
dateTextStyle: const TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w600,
|
||||||
color: AppTheme.primaryColor,
|
color: AppTheme.primaryColor,
|
||||||
),
|
),
|
||||||
dayTextStyle: TextStyle(
|
dayTextStyle: const TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
color: AppTheme.primaryColor,
|
color: AppTheme.primaryColor,
|
||||||
@ -106,7 +124,7 @@ class CalendarViewWidget extends StatelessWidget {
|
|||||||
selectionDecoration: BoxDecoration(
|
selectionDecoration: BoxDecoration(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
border: Border.all(color: AppTheme.primaryColor, width: 2),
|
border: Border.all(color: AppTheme.primaryColor, width: 2),
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(4)),
|
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
),
|
),
|
||||||
headerStyle: const CalendarHeaderStyle(
|
headerStyle: const CalendarHeaderStyle(
|
||||||
@ -163,6 +181,13 @@ class CalendarViewWidget extends StatelessWidget {
|
|||||||
? BoxDecoration(
|
? BoxDecoration(
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
color: AppTheme.primaryColor,
|
color: AppTheme.primaryColor,
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: AppTheme.primaryColor.withOpacity(0.3),
|
||||||
|
blurRadius: 4,
|
||||||
|
offset: const Offset(0, 2),
|
||||||
|
)
|
||||||
|
],
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -179,7 +204,7 @@ class CalendarViewWidget extends StatelessWidget {
|
|||||||
details.date.year == DateTime.now().year
|
details.date.year == DateTime.now().year
|
||||||
? Colors.white
|
? Colors.white
|
||||||
: AppTheme.primaryColor,
|
: AppTheme.primaryColor,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -201,12 +226,19 @@ class CalendarViewWidget extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
if (hasAppointments && details.appointments.isEmpty)
|
if (hasAppointments && details.appointments.isEmpty)
|
||||||
Container(
|
Container(
|
||||||
width: 6,
|
width: 8,
|
||||||
height: 6,
|
height: 8,
|
||||||
margin: const EdgeInsets.only(bottom: 2),
|
margin: const EdgeInsets.only(bottom: 2),
|
||||||
decoration: const BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
color: AppTheme.primaryColor,
|
color: AppTheme.primaryColor,
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: AppTheme.primaryColor.withOpacity(0.3),
|
||||||
|
blurRadius: 2,
|
||||||
|
spreadRadius: 0.5,
|
||||||
|
)
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -322,131 +354,245 @@ class CalendarViewWidget extends StatelessWidget {
|
|||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
shape: const RoundedRectangleBorder(
|
backgroundColor: Colors.transparent,
|
||||||
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
|
|
||||||
),
|
|
||||||
builder: (context) => Padding(
|
builder: (context) => Padding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
bottom: MediaQuery.of(context).viewInsets.bottom,
|
bottom: MediaQuery.of(context).viewInsets.bottom,
|
||||||
),
|
),
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(20),
|
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 24),
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.vertical(top: Radius.circular(24)),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.black26,
|
||||||
|
blurRadius: 10,
|
||||||
|
spreadRadius: 0,
|
||||||
|
offset: Offset(0, -2),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
constraints: BoxConstraints(
|
constraints: BoxConstraints(
|
||||||
maxHeight: MediaQuery.of(context).size.height * 0.7,
|
maxHeight: MediaQuery.of(context).size.height * 0.7,
|
||||||
),
|
),
|
||||||
child: SingleChildScrollView(
|
child: Column(
|
||||||
child: Column(
|
mainAxisSize: MainAxisSize.min,
|
||||||
mainAxisSize: MainAxisSize.min,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
children: [
|
||||||
children: [
|
// Handle bar
|
||||||
Row(
|
Center(
|
||||||
children: [
|
child: Container(
|
||||||
Expanded(
|
width: 40,
|
||||||
child: Text(
|
height: 5,
|
||||||
appointment.subject,
|
margin: const EdgeInsets.only(bottom: 20),
|
||||||
style: const TextStyle(
|
decoration: BoxDecoration(
|
||||||
fontSize: 20,
|
color: Colors.grey.shade300,
|
||||||
fontWeight: FontWeight.bold,
|
borderRadius: BorderRadius.circular(30),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
appointment.subject,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (status != null) _buildStatusBadge(status),
|
),
|
||||||
],
|
const SizedBox(width: 8),
|
||||||
|
if (status != null) _buildStatusBadge(status),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
|
||||||
|
// Date, time and location info
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.grey.shade50,
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
border: Border.all(color: Colors.grey.shade200),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
child: Column(
|
||||||
if (status != null) ...[
|
children: [
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Icon(
|
Container(
|
||||||
_getStatusIcon(status),
|
padding: const EdgeInsets.all(8),
|
||||||
size: 16,
|
decoration: BoxDecoration(
|
||||||
color: _getStatusColor(status),
|
color: AppTheme.primaryColor.withOpacity(0.1),
|
||||||
),
|
borderRadius: BorderRadius.circular(8),
|
||||||
const SizedBox(width: 8),
|
),
|
||||||
Text(
|
child: const Icon(
|
||||||
'Status: ${_getStatusText(status)}',
|
Icons.calendar_today,
|
||||||
style: TextStyle(
|
size: 16,
|
||||||
fontSize: 16,
|
color: AppTheme.primaryColor,
|
||||||
fontWeight: FontWeight.w500,
|
),
|
||||||
color: _getStatusColor(status),
|
|
||||||
),
|
),
|
||||||
|
const SizedBox(width: 12),
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Tanggal',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.grey.shade600,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 2),
|
||||||
|
Text(
|
||||||
|
formattedDate,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 14, fontWeight: FontWeight.w600),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.all(8),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AppTheme.primaryColor.withOpacity(0.1),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
child: const Icon(
|
||||||
|
Icons.access_time,
|
||||||
|
size: 16,
|
||||||
|
color: AppTheme.primaryColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 12),
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Waktu',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.grey.shade600,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 2),
|
||||||
|
Text(
|
||||||
|
'${appointment.startTime.hour}:${appointment.startTime.minute.toString().padLeft(2, '0')} - ${appointment.endTime.hour}:${appointment.endTime.minute.toString().padLeft(2, '0')} WIB',
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 14, fontWeight: FontWeight.w600),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
if (appointment.location != null &&
|
||||||
|
appointment.location!.isNotEmpty) ...[
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.all(8),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AppTheme.primaryColor.withOpacity(0.1),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
child: const Icon(
|
||||||
|
Icons.location_on,
|
||||||
|
size: 16,
|
||||||
|
color: AppTheme.primaryColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 12),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Lokasi',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.grey.shade600,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 2),
|
||||||
|
Text(
|
||||||
|
appointment.location!,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w600),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
|
||||||
const SizedBox(height: 8),
|
|
||||||
],
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
const Icon(Icons.calendar_today, size: 16),
|
|
||||||
const SizedBox(width: 8),
|
|
||||||
Text(
|
|
||||||
formattedDate,
|
|
||||||
style: const TextStyle(fontSize: 16),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
if (appointment.notes != null &&
|
||||||
|
appointment.notes!.isNotEmpty) ...[
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
Text(
|
||||||
|
'Deskripsi',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.grey.shade800,
|
||||||
|
),
|
||||||
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
Row(
|
Container(
|
||||||
children: [
|
padding: const EdgeInsets.all(16),
|
||||||
const Icon(Icons.access_time, size: 16),
|
decoration: BoxDecoration(
|
||||||
const SizedBox(width: 8),
|
color: Colors.grey.shade50,
|
||||||
Text(
|
borderRadius: BorderRadius.circular(12),
|
||||||
'${appointment.startTime.hour}:${appointment.startTime.minute.toString().padLeft(2, '0')} - ${appointment.endTime.hour}:${appointment.endTime.minute.toString().padLeft(2, '0')} WIB',
|
border: Border.all(color: Colors.grey.shade200),
|
||||||
style: const TextStyle(fontSize: 16),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
if (appointment.location != null &&
|
|
||||||
appointment.location!.isNotEmpty) ...[
|
|
||||||
const SizedBox(height: 8),
|
|
||||||
Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
const Icon(Icons.location_on, size: 16),
|
|
||||||
const SizedBox(width: 8),
|
|
||||||
Expanded(
|
|
||||||
child: Text(
|
|
||||||
appointment.location!,
|
|
||||||
style: const TextStyle(fontSize: 16),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
],
|
child: Text(
|
||||||
if (appointment.notes != null &&
|
|
||||||
appointment.notes!.isNotEmpty) ...[
|
|
||||||
const SizedBox(height: 16),
|
|
||||||
const Text(
|
|
||||||
'Deskripsi:',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 8),
|
|
||||||
Text(
|
|
||||||
appointment.notes!,
|
appointment.notes!,
|
||||||
style: const TextStyle(fontSize: 16),
|
style: TextStyle(
|
||||||
),
|
fontSize: 14,
|
||||||
],
|
color: Colors.grey.shade800,
|
||||||
const SizedBox(height: 20),
|
height: 1.5,
|
||||||
SizedBox(
|
|
||||||
width: double.infinity,
|
|
||||||
child: ElevatedButton(
|
|
||||||
onPressed: () => Navigator.pop(context),
|
|
||||||
style: ElevatedButton.styleFrom(
|
|
||||||
backgroundColor: AppTheme.primaryColor,
|
|
||||||
foregroundColor: Colors.white,
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
child: const Text('Tutup'),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
const SizedBox(height: 24),
|
||||||
|
SizedBox(
|
||||||
|
width: double.infinity,
|
||||||
|
child: ElevatedButton(
|
||||||
|
onPressed: () => Navigator.pop(context),
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
backgroundColor: AppTheme.primaryColor,
|
||||||
|
foregroundColor: Colors.white,
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 14),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
elevation: 0,
|
||||||
|
),
|
||||||
|
child: const Text(
|
||||||
|
'Tutup',
|
||||||
|
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -3,7 +3,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:penyaluran_app/app/data/models/penyaluran_bantuan_model.dart';
|
import 'package:penyaluran_app/app/data/models/penyaluran_bantuan_model.dart';
|
||||||
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/jadwal_penyaluran_controller.dart';
|
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/jadwal_penyaluran_controller.dart';
|
||||||
import 'package:penyaluran_app/app/routes/app_pages.dart';
|
import 'package:penyaluran_app/app/routes/app_pages.dart';
|
||||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
import 'package:penyaluran_app/app/utils/format_helper.dart';
|
||||||
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
||||||
|
|
||||||
class JadwalSectionWidget extends StatelessWidget {
|
class JadwalSectionWidget extends StatelessWidget {
|
||||||
@ -43,32 +43,56 @@ class JadwalSectionWidget extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 16),
|
||||||
Obx(() {
|
Obx(() {
|
||||||
final currentJadwalList = _getCurrentJadwalList();
|
final currentJadwalList = _getCurrentJadwalList();
|
||||||
|
|
||||||
if (currentJadwalList.isEmpty) {
|
if (currentJadwalList.isEmpty) {
|
||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(24),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.grey.withAlpha(20),
|
color: Colors.grey.shade50,
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
border: Border.all(color: Colors.grey.shade200),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.black.withOpacity(0.03),
|
||||||
|
blurRadius: 10,
|
||||||
|
offset: const Offset(0, 4),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Icon(
|
Container(
|
||||||
_getEmptyIcon(),
|
padding: const EdgeInsets.all(16),
|
||||||
size: 40,
|
decoration: BoxDecoration(
|
||||||
color: Colors.grey.shade400,
|
color: Colors.grey.shade100,
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
),
|
||||||
|
child: Icon(
|
||||||
|
_getEmptyIcon(),
|
||||||
|
size: 48,
|
||||||
|
color: Colors.grey.shade400,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 16),
|
||||||
Text(
|
Text(
|
||||||
'Tidak ada jadwal $title',
|
'Tidak ada jadwal $title',
|
||||||
style: textTheme.titleMedium?.copyWith(
|
style: textTheme.titleMedium?.copyWith(
|
||||||
color: Colors.grey.shade600,
|
color: Colors.grey.shade600,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
Text(
|
||||||
|
'Jadwal akan muncul di sini saat tersedia',
|
||||||
|
style: textTheme.bodySmall?.copyWith(
|
||||||
|
color: Colors.grey.shade500,
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -192,17 +216,18 @@ class JadwalSectionWidget extends StatelessWidget {
|
|||||||
controller.getKategoriBantuanName(jadwal.kategoriBantuanId);
|
controller.getKategoriBantuanName(jadwal.kategoriBantuanId);
|
||||||
|
|
||||||
return Card(
|
return Card(
|
||||||
margin: const EdgeInsets.only(bottom: 12),
|
margin: const EdgeInsets.only(bottom: 16),
|
||||||
elevation: 2,
|
elevation: 3,
|
||||||
|
shadowColor: Colors.black.withOpacity(0.1),
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(16),
|
||||||
side: BorderSide(
|
side: BorderSide(
|
||||||
color: statusColor.withOpacity(0.3),
|
color: statusColor.withOpacity(0.3),
|
||||||
width: 1,
|
width: 1.5,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(16),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (jadwal.id != null) {
|
if (jadwal.id != null) {
|
||||||
Get.toNamed(Routes.detailPenyaluran,
|
Get.toNamed(Routes.detailPenyaluran,
|
||||||
@ -223,19 +248,19 @@ class JadwalSectionWidget extends StatelessWidget {
|
|||||||
Row(
|
Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
// Container(
|
Container(
|
||||||
// padding: const EdgeInsets.all(10),
|
padding: const EdgeInsets.all(10),
|
||||||
// decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
// color: statusColor.withOpacity(0.1),
|
color: statusColor.withOpacity(0.1),
|
||||||
// borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(12),
|
||||||
// ),
|
),
|
||||||
// child: Icon(
|
child: Icon(
|
||||||
// _getStatusIcon(),
|
_getStatusIcon(),
|
||||||
// color: statusColor,
|
color: statusColor,
|
||||||
// size: 24,
|
size: 24,
|
||||||
// ),
|
),
|
||||||
// ),
|
),
|
||||||
// const SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@ -254,12 +279,16 @@ class JadwalSectionWidget extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 8,
|
horizontal: 10,
|
||||||
vertical: 4,
|
vertical: 6,
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: statusColor.withOpacity(0.1),
|
color: statusColor.withOpacity(0.15),
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
border: Border.all(
|
||||||
|
color: statusColor.withOpacity(0.3),
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
statusText,
|
statusText,
|
||||||
@ -273,10 +302,12 @@ class JadwalSectionWidget extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
if (jadwal.deskripsi != null &&
|
if (jadwal.deskripsi != null &&
|
||||||
jadwal.deskripsi!.isNotEmpty) ...[
|
jadwal.deskripsi!.isNotEmpty) ...[
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 6),
|
||||||
Text(
|
Text(
|
||||||
jadwal.deskripsi!,
|
jadwal.deskripsi!,
|
||||||
style: textTheme.bodyMedium,
|
style: textTheme.bodyMedium?.copyWith(
|
||||||
|
color: Colors.grey.shade700,
|
||||||
|
),
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
@ -287,47 +318,18 @@ class JadwalSectionWidget extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
const Divider(height: 24),
|
const Divider(height: 24),
|
||||||
_buildInfoItem(
|
_buildInfoSection(
|
||||||
Icons.location_on_outlined,
|
|
||||||
'Lokasi',
|
|
||||||
lokasiName,
|
|
||||||
textTheme,
|
textTheme,
|
||||||
|
lokasiName,
|
||||||
|
kategoriName,
|
||||||
|
formattedDateTime,
|
||||||
|
jadwal.jumlahPenerima,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 12),
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: _buildInfoItem(
|
|
||||||
Icons.category_outlined,
|
|
||||||
'Kategori',
|
|
||||||
kategoriName,
|
|
||||||
textTheme,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: _buildInfoItem(
|
|
||||||
Icons.event,
|
|
||||||
'Jadwal',
|
|
||||||
formattedDateTime,
|
|
||||||
textTheme,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
if (jadwal.jumlahPenerima != null) ...[
|
|
||||||
const SizedBox(height: 8),
|
|
||||||
_buildInfoItem(
|
|
||||||
Icons.people_outline,
|
|
||||||
'Jumlah Penerima',
|
|
||||||
'${jadwal.jumlahPenerima}',
|
|
||||||
textTheme,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
const SizedBox(height: 16),
|
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
TextButton.icon(
|
ElevatedButton.icon(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (jadwal.id != null) {
|
if (jadwal.id != null) {
|
||||||
Get.toNamed(Routes.detailPenyaluran,
|
Get.toNamed(Routes.detailPenyaluran,
|
||||||
@ -340,10 +342,19 @@ class JadwalSectionWidget extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
icon: const Icon(Icons.visibility_outlined),
|
icon: const Icon(Icons.visibility_outlined, size: 18),
|
||||||
label: const Text('Lihat Detail'),
|
label: const Text('Lihat Detail'),
|
||||||
style: TextButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
foregroundColor: statusColor,
|
foregroundColor: Colors.white,
|
||||||
|
backgroundColor: statusColor,
|
||||||
|
elevation: 0,
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 16,
|
||||||
|
vertical: 8,
|
||||||
|
),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -355,6 +366,66 @@ class JadwalSectionWidget extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _buildInfoSection(
|
||||||
|
TextTheme textTheme,
|
||||||
|
String lokasiName,
|
||||||
|
String kategoriName,
|
||||||
|
String formattedDateTime,
|
||||||
|
int? jumlahPenerima,
|
||||||
|
) {
|
||||||
|
return Container(
|
||||||
|
padding: const EdgeInsets.all(12),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.grey.shade50,
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
border: Border.all(
|
||||||
|
color: Colors.grey.shade200,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
_buildInfoItem(
|
||||||
|
Icons.location_on_outlined,
|
||||||
|
'Lokasi',
|
||||||
|
lokasiName,
|
||||||
|
textTheme,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: _buildInfoItem(
|
||||||
|
Icons.category_outlined,
|
||||||
|
'Kategori',
|
||||||
|
kategoriName,
|
||||||
|
textTheme,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: _buildInfoItem(
|
||||||
|
Icons.event,
|
||||||
|
'Jadwal',
|
||||||
|
formattedDateTime,
|
||||||
|
textTheme,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
if (jumlahPenerima != null) ...[
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
_buildInfoItem(
|
||||||
|
Icons.people_outline,
|
||||||
|
'Jumlah Penerima',
|
||||||
|
'$jumlahPenerima',
|
||||||
|
textTheme,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Widget _buildInfoItem(
|
Widget _buildInfoItem(
|
||||||
IconData icon,
|
IconData icon,
|
||||||
String label,
|
String label,
|
||||||
@ -364,12 +435,19 @@ class JadwalSectionWidget extends StatelessWidget {
|
|||||||
return Row(
|
return Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Icon(
|
Container(
|
||||||
icon,
|
padding: const EdgeInsets.all(6),
|
||||||
size: 16,
|
decoration: BoxDecoration(
|
||||||
color: Colors.grey.shade600,
|
color: Colors.grey.shade200,
|
||||||
|
borderRadius: BorderRadius.circular(6),
|
||||||
|
),
|
||||||
|
child: Icon(
|
||||||
|
icon,
|
||||||
|
size: 14,
|
||||||
|
color: Colors.grey.shade700,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 4),
|
const SizedBox(width: 8),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@ -378,11 +456,15 @@ class JadwalSectionWidget extends StatelessWidget {
|
|||||||
label,
|
label,
|
||||||
style: textTheme.bodySmall?.copyWith(
|
style: textTheme.bodySmall?.copyWith(
|
||||||
color: Colors.grey.shade600,
|
color: Colors.grey.shade600,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
const SizedBox(height: 2),
|
||||||
Text(
|
Text(
|
||||||
value,
|
value,
|
||||||
style: textTheme.bodyMedium,
|
style: textTheme.bodyMedium?.copyWith(
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
),
|
),
|
||||||
|
@ -7,7 +7,7 @@ import 'package:penyaluran_app/app/data/models/user_model.dart';
|
|||||||
import 'package:penyaluran_app/app/data/models/skema_bantuan_model.dart';
|
import 'package:penyaluran_app/app/data/models/skema_bantuan_model.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/services/supabase_service.dart';
|
import 'package:penyaluran_app/app/services/supabase_service.dart';
|
||||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
import 'package:penyaluran_app/app/utils/format_helper.dart';
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:crypto/crypto.dart';
|
import 'package:crypto/crypto.dart';
|
||||||
|
@ -4,7 +4,7 @@ import 'package:penyaluran_app/app/data/models/penerima_penyaluran_model.dart';
|
|||||||
import 'package:penyaluran_app/app/data/models/penyaluran_bantuan_model.dart';
|
import 'package:penyaluran_app/app/data/models/penyaluran_bantuan_model.dart';
|
||||||
import 'package:penyaluran_app/app/data/models/skema_bantuan_model.dart';
|
import 'package:penyaluran_app/app/data/models/skema_bantuan_model.dart';
|
||||||
import 'package:penyaluran_app/app/services/supabase_service.dart';
|
import 'package:penyaluran_app/app/services/supabase_service.dart';
|
||||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
import 'package:penyaluran_app/app/utils/format_helper.dart';
|
||||||
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
||||||
|
|
||||||
class PelaksanaanPenyaluranController extends GetxController {
|
class PelaksanaanPenyaluranController extends GetxController {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:penyaluran_app/app/services/supabase_service.dart';
|
import 'package:penyaluran_app/app/services/supabase_service.dart';
|
||||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
import 'package:penyaluran_app/app/utils/format_helper.dart';
|
||||||
|
|
||||||
class PenerimaController extends GetxController {
|
class PenerimaController extends GetxController {
|
||||||
final RxList<Map<String, dynamic>> daftarPenerima =
|
final RxList<Map<String, dynamic>> daftarPenerima =
|
||||||
|
@ -296,6 +296,32 @@ class PengaduanController extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> updateStatusTindakan(String pengaduanId) async {
|
||||||
|
isLoading.value = true;
|
||||||
|
try {
|
||||||
|
await _supabaseService.updateStatusPengaduan(pengaduanId, 'TINDAKAN');
|
||||||
|
await loadPengaduanData();
|
||||||
|
Get.snackbar(
|
||||||
|
'Sukses',
|
||||||
|
'Pengaduan berhasil diubah ke status Tindakan',
|
||||||
|
snackPosition: SnackPosition.TOP,
|
||||||
|
backgroundColor: Colors.blue,
|
||||||
|
colorText: Colors.white,
|
||||||
|
);
|
||||||
|
} catch (e) {
|
||||||
|
print('Error updating to Tindakan status: $e');
|
||||||
|
Get.snackbar(
|
||||||
|
'Error',
|
||||||
|
'Gagal mengubah status ke Tindakan: ${e.toString()}',
|
||||||
|
snackPosition: SnackPosition.TOP,
|
||||||
|
backgroundColor: Colors.red,
|
||||||
|
colorText: Colors.white,
|
||||||
|
);
|
||||||
|
} finally {
|
||||||
|
isLoading.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future<List<TindakanPengaduanModel>> getTindakanPengaduan(
|
Future<List<TindakanPengaduanModel>> getTindakanPengaduan(
|
||||||
String pengaduanId) async {
|
String pengaduanId) async {
|
||||||
try {
|
try {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:penyaluran_app/app/routes/app_pages.dart';
|
import 'package:penyaluran_app/app/routes/app_pages.dart';
|
||||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
import 'package:penyaluran_app/app/utils/format_helper.dart';
|
||||||
import 'package:percent_indicator/circular_percent_indicator.dart';
|
import 'package:percent_indicator/circular_percent_indicator.dart';
|
||||||
import 'package:penyaluran_app/app/modules/petugas_desa/components/greeting_header.dart';
|
import 'package:penyaluran_app/app/modules/petugas_desa/components/greeting_header.dart';
|
||||||
import 'package:penyaluran_app/app/modules/petugas_desa/components/schedule_card.dart';
|
import 'package:penyaluran_app/app/modules/petugas_desa/components/schedule_card.dart';
|
||||||
|
@ -4,7 +4,7 @@ import 'package:penyaluran_app/app/modules/petugas_desa/controllers/donatur_cont
|
|||||||
import 'package:penyaluran_app/app/data/models/donatur_model.dart';
|
import 'package:penyaluran_app/app/data/models/donatur_model.dart';
|
||||||
import 'package:penyaluran_app/app/data/models/penitipan_bantuan_model.dart';
|
import 'package:penyaluran_app/app/data/models/penitipan_bantuan_model.dart';
|
||||||
import 'package:penyaluran_app/app/widgets/dialogs/detail_penitipan_dialog.dart';
|
import 'package:penyaluran_app/app/widgets/dialogs/detail_penitipan_dialog.dart';
|
||||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
import 'package:penyaluran_app/app/utils/format_helper.dart';
|
||||||
|
|
||||||
class DetailDonaturView extends GetView<DonaturController> {
|
class DetailDonaturView extends GetView<DonaturController> {
|
||||||
const DetailDonaturView({super.key});
|
const DetailDonaturView({super.key});
|
||||||
|
@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/penerima_controller.dart';
|
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/penerima_controller.dart';
|
||||||
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
||||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
import 'package:penyaluran_app/app/utils/format_helper.dart';
|
||||||
|
|
||||||
class DetailPenerimaView extends GetView<PenerimaController> {
|
class DetailPenerimaView extends GetView<PenerimaController> {
|
||||||
const DetailPenerimaView({super.key});
|
const DetailPenerimaView({super.key});
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -8,7 +8,7 @@ import 'package:image_picker/image_picker.dart';
|
|||||||
import 'package:signature/signature.dart';
|
import 'package:signature/signature.dart';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:typed_data';
|
import 'dart:typed_data';
|
||||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
import 'package:penyaluran_app/app/utils/format_helper.dart';
|
||||||
|
|
||||||
class KonfirmasiPenerimaPage extends StatefulWidget {
|
class KonfirmasiPenerimaPage extends StatefulWidget {
|
||||||
final PenerimaPenyaluranModel penerima;
|
final PenerimaPenyaluranModel penerima;
|
||||||
|
@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/pengaduan_controller.dart';
|
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/pengaduan_controller.dart';
|
||||||
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
||||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
import 'package:penyaluran_app/app/utils/format_helper.dart';
|
||||||
|
|
||||||
class PengaduanView extends GetView<PengaduanController> {
|
class PengaduanView extends GetView<PengaduanController> {
|
||||||
const PengaduanView({super.key});
|
const PengaduanView({super.key});
|
||||||
|
@ -3,7 +3,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:penyaluran_app/app/data/models/penitipan_bantuan_model.dart';
|
import 'package:penyaluran_app/app/data/models/penitipan_bantuan_model.dart';
|
||||||
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/penitipan_bantuan_controller.dart';
|
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/penitipan_bantuan_controller.dart';
|
||||||
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
||||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
import 'package:penyaluran_app/app/utils/format_helper.dart';
|
||||||
import 'package:penyaluran_app/app/widgets/dialogs/detail_penitipan_dialog.dart';
|
import 'package:penyaluran_app/app/widgets/dialogs/detail_penitipan_dialog.dart';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ import 'package:penyaluran_app/app/modules/petugas_desa/views/tambah_penyaluran_
|
|||||||
|
|
||||||
class PenyaluranView extends GetView<JadwalPenyaluranController> {
|
class PenyaluranView extends GetView<JadwalPenyaluranController> {
|
||||||
const PenyaluranView({super.key});
|
const PenyaluranView({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return DefaultTabController(
|
return DefaultTabController(
|
||||||
@ -24,6 +23,10 @@ class PenyaluranView extends GetView<JadwalPenyaluranController> {
|
|||||||
labelColor: AppTheme.primaryColor,
|
labelColor: AppTheme.primaryColor,
|
||||||
indicatorColor: AppTheme.primaryColor,
|
indicatorColor: AppTheme.primaryColor,
|
||||||
unselectedLabelColor: Colors.grey,
|
unselectedLabelColor: Colors.grey,
|
||||||
|
unselectedLabelStyle: const TextStyle(
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
fontSize: 13,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: TabBarView(
|
child: TabBarView(
|
||||||
@ -38,10 +41,13 @@ class PenyaluranView extends GetView<JadwalPenyaluranController> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton.extended(
|
||||||
onPressed: () => Get.to(() => const TambahPenyaluranView()),
|
onPressed: () => Get.to(() => const TambahPenyaluranView()),
|
||||||
backgroundColor: AppTheme.primaryColor,
|
backgroundColor: AppTheme.primaryColor,
|
||||||
child: const Icon(Icons.add, color: Colors.white),
|
icon: const Icon(Icons.add, color: Colors.white),
|
||||||
|
label: const Text('Tambah Jadwal',
|
||||||
|
style: TextStyle(color: Colors.white)),
|
||||||
|
elevation: 2,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -53,12 +59,12 @@ class PenyaluranView extends GetView<JadwalPenyaluranController> {
|
|||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 20.0),
|
||||||
child: Obx(() {
|
child: Obx(() {
|
||||||
if (controller.isLoading.value) {
|
if (controller.isLoading.value) {
|
||||||
return const Center(
|
return const SizedBox(
|
||||||
child: Padding(
|
height: 300,
|
||||||
padding: EdgeInsets.all(32.0),
|
child: Center(
|
||||||
child: CircularProgressIndicator(),
|
child: CircularProgressIndicator(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -70,7 +76,7 @@ class PenyaluranView extends GetView<JadwalPenyaluranController> {
|
|||||||
// Ringkasan jadwal
|
// Ringkasan jadwal
|
||||||
_buildJadwalSummary(Get.context!),
|
_buildJadwalSummary(Get.context!),
|
||||||
|
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 24),
|
||||||
|
|
||||||
// Jadwal hari ini
|
// Jadwal hari ini
|
||||||
JadwalSectionWidget(
|
JadwalSectionWidget(
|
||||||
@ -80,7 +86,7 @@ class PenyaluranView extends GetView<JadwalPenyaluranController> {
|
|||||||
status: 'Aktif',
|
status: 'Aktif',
|
||||||
),
|
),
|
||||||
|
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 24),
|
||||||
|
|
||||||
// Jadwal mendatang
|
// Jadwal mendatang
|
||||||
JadwalSectionWidget(
|
JadwalSectionWidget(
|
||||||
@ -90,7 +96,7 @@ class PenyaluranView extends GetView<JadwalPenyaluranController> {
|
|||||||
status: 'Terjadwal',
|
status: 'Terjadwal',
|
||||||
),
|
),
|
||||||
|
|
||||||
const SizedBox(height: 50),
|
const SizedBox(height: 60),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
@ -105,12 +111,12 @@ class PenyaluranView extends GetView<JadwalPenyaluranController> {
|
|||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 20.0),
|
||||||
child: Obx(() {
|
child: Obx(() {
|
||||||
if (controller.isLoading.value) {
|
if (controller.isLoading.value) {
|
||||||
return const Center(
|
return const SizedBox(
|
||||||
child: Padding(
|
height: 300,
|
||||||
padding: EdgeInsets.all(32.0),
|
child: Center(
|
||||||
child: CircularProgressIndicator(),
|
child: CircularProgressIndicator(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/riwayat_pengaduan_controller.dart';
|
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/riwayat_pengaduan_controller.dart';
|
||||||
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
||||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
import 'package:penyaluran_app/app/utils/format_helper.dart';
|
||||||
|
|
||||||
class RiwayatPengaduanView extends GetView<RiwayatPengaduanController> {
|
class RiwayatPengaduanView extends GetView<RiwayatPengaduanController> {
|
||||||
const RiwayatPengaduanView({super.key});
|
const RiwayatPengaduanView({super.key});
|
||||||
@ -159,253 +159,388 @@ class RiwayatPengaduanView extends GetView<RiwayatPengaduanController> {
|
|||||||
formattedDate = DateTimeHelper.formatDate(item.createdAt);
|
formattedDate = DateTimeHelper.formatDate(item.createdAt);
|
||||||
}
|
}
|
||||||
|
|
||||||
return InkWell(
|
Color statusColor = AppTheme.successColor;
|
||||||
onTap: () {
|
IconData statusIcon = Icons.check_circle;
|
||||||
// Navigasi ke halaman detail pengaduan
|
|
||||||
Get.toNamed('/detail-pengaduan', arguments: {'id': item.id});
|
return Card(
|
||||||
},
|
margin: const EdgeInsets.only(bottom: 16),
|
||||||
borderRadius: BorderRadius.circular(12),
|
shape: RoundedRectangleBorder(
|
||||||
child: Container(
|
borderRadius: BorderRadius.circular(12),
|
||||||
width: double.infinity,
|
side: BorderSide(
|
||||||
margin: const EdgeInsets.only(bottom: 12),
|
color: statusColor.withOpacity(0.3),
|
||||||
decoration: BoxDecoration(
|
width: 1,
|
||||||
color: Colors.white,
|
|
||||||
borderRadius: BorderRadius.circular(12),
|
|
||||||
boxShadow: [
|
|
||||||
BoxShadow(
|
|
||||||
color: Colors.grey.withAlpha(26),
|
|
||||||
spreadRadius: 1,
|
|
||||||
blurRadius: 3,
|
|
||||||
offset: const Offset(0, 1),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
child: Padding(
|
),
|
||||||
padding: const EdgeInsets.all(16.0),
|
elevation: 3,
|
||||||
child: Column(
|
child: InkWell(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
onTap: () {
|
||||||
children: [
|
// Navigasi ke halaman detail pengaduan
|
||||||
Row(
|
Get.toNamed('/detail-pengaduan', arguments: {'id': item.id});
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
},
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
// Header dengan warna sesuai status
|
||||||
|
Container(
|
||||||
|
width: double.infinity,
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: statusColor.withOpacity(0.1),
|
||||||
|
borderRadius: const BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(12),
|
||||||
|
topRight: Radius.circular(12),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Row(
|
||||||
item.warga?['nama'] ?? item.judul ?? '',
|
children: [
|
||||||
style: Theme.of(context).textTheme.titleMedium?.copyWith(
|
Icon(
|
||||||
fontWeight: FontWeight.bold,
|
Icons.report_problem,
|
||||||
|
color: statusColor,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Flexible(
|
||||||
|
child: Text(
|
||||||
|
item.warga?['nama'] ?? item.judul ?? '',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: statusColor,
|
||||||
|
),
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 12),
|
|
||||||
Container(
|
Container(
|
||||||
padding:
|
padding: const EdgeInsets.symmetric(
|
||||||
const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
horizontal: 12,
|
||||||
|
vertical: 6,
|
||||||
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppTheme.successColor.withOpacity(0.1),
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
border: Border.all(
|
||||||
|
color: statusColor,
|
||||||
|
width: 1.0,
|
||||||
|
),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.black.withOpacity(0.05),
|
||||||
|
blurRadius: 3,
|
||||||
|
offset: const Offset(0, 1),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
const Icon(
|
Icon(
|
||||||
Icons.check_circle,
|
statusIcon,
|
||||||
size: 16,
|
size: 14,
|
||||||
color: AppTheme.successColor,
|
color: statusColor,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 4),
|
const SizedBox(width: 4),
|
||||||
Text(
|
Text(
|
||||||
'SELESAI',
|
'SELESAI',
|
||||||
style:
|
style: TextStyle(
|
||||||
Theme.of(context).textTheme.bodySmall?.copyWith(
|
color: statusColor,
|
||||||
color: AppTheme.successColor,
|
fontWeight: FontWeight.bold,
|
||||||
fontWeight: FontWeight.bold,
|
fontSize: 12,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
),
|
||||||
Text(
|
|
||||||
item.deskripsi ?? '',
|
Padding(
|
||||||
style: Theme.of(context).textTheme.bodyMedium,
|
padding: const EdgeInsets.all(16),
|
||||||
maxLines: 2,
|
child: Column(
|
||||||
overflow: TextOverflow.ellipsis,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
),
|
|
||||||
const SizedBox(height: 12),
|
|
||||||
Row(
|
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
// Deskripsi masalah
|
||||||
child: _buildItemDetail(
|
if (item.deskripsi != null && item.deskripsi.isNotEmpty)
|
||||||
context,
|
Container(
|
||||||
icon: Icons.person,
|
width: double.infinity,
|
||||||
label: 'Pelapor',
|
padding: const EdgeInsets.all(12),
|
||||||
value: item.warga?['nama_lengkap'] ?? '',
|
margin: const EdgeInsets.only(bottom: 16),
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
),
|
color: Colors.grey.shade50,
|
||||||
Expanded(
|
borderRadius: BorderRadius.circular(10),
|
||||||
child: _buildItemDetail(
|
border: Border.all(
|
||||||
context,
|
color: Colors.grey.shade200,
|
||||||
icon: Icons.numbers,
|
width: 1.0,
|
||||||
label: 'NIK',
|
),
|
||||||
value: item.warga?['nik'] ?? '',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(height: 12),
|
|
||||||
if (item.penerimaPenyaluran != null) ...[
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: _buildItemDetail(
|
|
||||||
context,
|
|
||||||
icon: Icons.shopping_bag,
|
|
||||||
label: 'Jumlah',
|
|
||||||
value:
|
|
||||||
'${item.jumlahBantuan} ${item.stokBantuan['satuan']}',
|
|
||||||
)),
|
|
||||||
Expanded(
|
|
||||||
child: _buildItemDetail(
|
|
||||||
context,
|
|
||||||
icon: Icons.inventory,
|
|
||||||
label: 'Stok Bantuan',
|
|
||||||
value: item.stokBantuan['nama'] ?? '',
|
|
||||||
),
|
),
|
||||||
),
|
child: Column(
|
||||||
],
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
),
|
|
||||||
const SizedBox(height: 8),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: _buildItemDetail(
|
|
||||||
context,
|
|
||||||
icon: Icons.category,
|
|
||||||
label: 'Nama Penyaluran',
|
|
||||||
value: item.namaPenyaluran ?? '',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: _buildItemDetail(
|
|
||||||
context,
|
|
||||||
icon: Icons.calendar_today,
|
|
||||||
label: 'Tanggal',
|
|
||||||
value: formattedDate,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
if (item.ratingWarga != null && item.ratingWarga > 0) ...[
|
|
||||||
const SizedBox(height: 12),
|
|
||||||
Container(
|
|
||||||
padding: const EdgeInsets.all(8),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.amber.withOpacity(0.1),
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
border: Border.all(color: Colors.amber.shade200),
|
|
||||||
),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Feedback Warga',
|
'Deskripsi Masalah:',
|
||||||
style: const TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 14,
|
color: Colors.grey.shade800,
|
||||||
color: Colors.amber,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Row(
|
const SizedBox(height: 6),
|
||||||
children: List.generate(5, (index) {
|
Text(
|
||||||
return Icon(
|
item.deskripsi ?? '',
|
||||||
index < (item.ratingWarga ?? 0)
|
style: TextStyle(
|
||||||
? Icons.star
|
color: Colors.grey.shade700,
|
||||||
: Icons.star_border,
|
),
|
||||||
color: Colors.amber,
|
|
||||||
size: 16,
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (item.feedbackWarga != null &&
|
),
|
||||||
item.feedbackWarga.isNotEmpty) ...[
|
|
||||||
const SizedBox(height: 4),
|
// Informasi penyaluran bantuan jika ada
|
||||||
Text(
|
if (item.penerimaPenyaluran != null) ...[
|
||||||
'${item.feedbackWarga}',
|
Container(
|
||||||
style: Theme.of(context).textTheme.bodySmall,
|
width: double.infinity,
|
||||||
|
padding: const EdgeInsets.all(12),
|
||||||
|
margin: const EdgeInsets.only(bottom: 16),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.blue.shade50,
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
border: Border.all(
|
||||||
|
color: Colors.blue.shade200,
|
||||||
|
width: 1.0,
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Penyaluran: ${item.namaPenyaluran ?? "Tidak tersedia"}',
|
||||||
|
style: const TextStyle(
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 6),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Bantuan',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.grey.shade600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
item.stokBantuan['nama'] ?? '-',
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Colors.grey.shade800,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Jumlah',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.grey.shade600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'${item.jumlahBantuan} ${item.stokBantuan['satuan'] ?? ''}',
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Colors.grey.shade800,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
|
||||||
|
// Informasi pelapor dan NIK
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Pelapor',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.grey.shade600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
item.warga?['nama_lengkap'] ?? '-',
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Colors.grey.shade800,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'NIK',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.grey.shade600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
item.warga?['nik'] ?? '-',
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Colors.grey.shade800,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
|
||||||
],
|
const SizedBox(height: 12),
|
||||||
const SizedBox(height: 12),
|
|
||||||
Row(
|
// Informasi tanggal
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
Container(
|
||||||
children: [
|
padding:
|
||||||
TextButton.icon(
|
const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||||
onPressed: () {
|
decoration: BoxDecoration(
|
||||||
// Navigasi ke halaman detail pengaduan
|
color: Colors.grey.shade100,
|
||||||
Get.toNamed('/detail-pengaduan',
|
borderRadius: BorderRadius.circular(4),
|
||||||
arguments: {'id': item.id});
|
|
||||||
},
|
|
||||||
icon: const Icon(Icons.info_outline, size: 18),
|
|
||||||
label: const Text('Detail'),
|
|
||||||
style: TextButton.styleFrom(
|
|
||||||
foregroundColor: Colors.grey,
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
|
||||||
),
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Icons.calendar_today,
|
||||||
|
size: 12,
|
||||||
|
color: Colors.grey.shade700,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 4),
|
||||||
|
Text(
|
||||||
|
formattedDate,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.grey.shade800,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
// Rating dan feedback warga jika ada
|
||||||
|
if (item.ratingWarga != null && item.ratingWarga > 0) ...[
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.all(12),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.amber.withOpacity(0.1),
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
border: Border.all(
|
||||||
|
color: Colors.amber.shade200,
|
||||||
|
width: 1.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Feedback Warga',
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 14,
|
||||||
|
color: Colors.amber.shade800,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: List.generate(5, (index) {
|
||||||
|
return Icon(
|
||||||
|
index < (item.ratingWarga ?? 0)
|
||||||
|
? Icons.star
|
||||||
|
: Icons.star_border,
|
||||||
|
color: Colors.amber,
|
||||||
|
size: 16,
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
if (item.feedbackWarga != null &&
|
||||||
|
item.feedbackWarga.isNotEmpty) ...[
|
||||||
|
const SizedBox(height: 6),
|
||||||
|
Text(
|
||||||
|
'${item.feedbackWarga}',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.grey.shade700,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
|
||||||
|
// Tombol detail
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
ElevatedButton.icon(
|
||||||
|
onPressed: () {
|
||||||
|
Get.toNamed('/detail-pengaduan',
|
||||||
|
arguments: {'id': item.id});
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.info_outline, size: 18),
|
||||||
|
label: const Text('Lihat Detail'),
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
backgroundColor: statusColor,
|
||||||
|
foregroundColor: Colors.white,
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 16, vertical: 8),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildItemDetail(
|
|
||||||
BuildContext context, {
|
|
||||||
required IconData icon,
|
|
||||||
required String label,
|
|
||||||
required String value,
|
|
||||||
}) {
|
|
||||||
return Row(
|
|
||||||
children: [
|
|
||||||
Icon(
|
|
||||||
icon,
|
|
||||||
size: 16,
|
|
||||||
color: Colors.grey,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 4),
|
|
||||||
Expanded(
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
label,
|
|
||||||
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
|
||||||
color: Colors.grey,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
value,
|
|
||||||
style: Theme.of(context).textTheme.bodyMedium,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:penyaluran_app/app/data/models/penitipan_bantuan_model.dart';
|
import 'package:penyaluran_app/app/data/models/penitipan_bantuan_model.dart';
|
||||||
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/penitipan_bantuan_controller.dart';
|
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/penitipan_bantuan_controller.dart';
|
||||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
import 'package:penyaluran_app/app/utils/format_helper.dart';
|
||||||
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
||||||
|
|
||||||
class RiwayatPenitipanView extends GetView<PenitipanBantuanController> {
|
class RiwayatPenitipanView extends GetView<PenitipanBantuanController> {
|
||||||
@ -208,151 +208,348 @@ class RiwayatPenitipanView extends GetView<PenitipanBantuanController> {
|
|||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
margin: const EdgeInsets.only(bottom: 12),
|
margin: const EdgeInsets.only(bottom: 16),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(16),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Colors.grey.withAlpha(26),
|
color: Colors.grey.withOpacity(0.15),
|
||||||
spreadRadius: 1,
|
spreadRadius: 2,
|
||||||
blurRadius: 3,
|
blurRadius: 8,
|
||||||
offset: const Offset(0, 1),
|
offset: const Offset(0, 3),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
border: Border.all(
|
||||||
|
color: statusColor.withOpacity(0.3),
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: ClipRRect(
|
||||||
padding: const EdgeInsets.all(16.0),
|
borderRadius: BorderRadius.circular(16),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
// Header dengan status
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
Container(
|
||||||
children: [
|
color: statusColor.withOpacity(0.1),
|
||||||
Expanded(
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||||
child: Text(
|
child: Row(
|
||||||
donaturNama,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
style: Theme.of(context).textTheme.titleMedium?.copyWith(
|
children: [
|
||||||
fontWeight: FontWeight.bold,
|
Row(
|
||||||
),
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
padding:
|
|
||||||
const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: statusColor.withOpacity(0.1),
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
children: [
|
||||||
Icon(
|
Container(
|
||||||
statusIcon,
|
padding: const EdgeInsets.all(6),
|
||||||
size: 16,
|
decoration: BoxDecoration(
|
||||||
color: statusColor,
|
color: statusColor.withOpacity(0.2),
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
),
|
||||||
|
child: Icon(
|
||||||
|
statusIcon,
|
||||||
|
size: 16,
|
||||||
|
color: statusColor,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 4),
|
const SizedBox(width: 8),
|
||||||
Text(
|
Text(
|
||||||
item.status ?? 'Tidak diketahui',
|
item.status ?? 'Tidak diketahui',
|
||||||
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||||
color: statusColor,
|
color: statusColor,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
Text(
|
||||||
],
|
DateTimeHelper.formatDate(item.createdAt),
|
||||||
),
|
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
||||||
const SizedBox(height: 12),
|
color: Colors.grey.shade700,
|
||||||
Row(
|
fontStyle: FontStyle.italic,
|
||||||
children: [
|
),
|
||||||
Expanded(
|
|
||||||
child: _buildItemDetail(
|
|
||||||
context,
|
|
||||||
icon: isUang ? Icons.monetization_on : Icons.category,
|
|
||||||
label: 'Kategori Bantuan',
|
|
||||||
value: kategoriNama,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: _buildItemDetail(
|
|
||||||
context,
|
|
||||||
icon:
|
|
||||||
isUang ? Icons.account_balance_wallet : Icons.inventory,
|
|
||||||
label: 'Jumlah',
|
|
||||||
value: isUang
|
|
||||||
? 'Rp ${DateTimeHelper.formatNumber(item.jumlah)}'
|
|
||||||
: '${DateTimeHelper.formatNumber(item.jumlah)} $kategoriSatuan',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(height: 8),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: _buildItemDetail(
|
|
||||||
context,
|
|
||||||
icon: Icons.calendar_today,
|
|
||||||
label: item.status == 'TERVERIFIKASI'
|
|
||||||
? 'Tanggal Verifikasi'
|
|
||||||
: 'Tanggal Penolakan',
|
|
||||||
value: DateTimeHelper.formatDateTime(
|
|
||||||
item.status == 'TERVERIFIKASI'
|
|
||||||
? item.tanggalVerifikasi
|
|
||||||
: item.updatedAt,
|
|
||||||
defaultValue: 'Tidak ada tanggal'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
if (item.status == 'TERVERIFIKASI' &&
|
|
||||||
item.petugasDesaId != null)
|
|
||||||
Expanded(
|
|
||||||
child: GetBuilder<PenitipanBantuanController>(
|
|
||||||
id: 'petugas_data',
|
|
||||||
builder: (controller) => _buildItemDetail(
|
|
||||||
context,
|
|
||||||
icon: Icons.person,
|
|
||||||
label: 'Diverifikasi Oleh',
|
|
||||||
value:
|
|
||||||
controller.getPetugasDesaNama(item.petugasDesaId),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
if (item.alasanPenolakan != null &&
|
|
||||||
item.alasanPenolakan!.isNotEmpty)
|
|
||||||
Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
const SizedBox(height: 8),
|
|
||||||
_buildItemDetail(
|
|
||||||
context,
|
|
||||||
icon: Icons.info_outline,
|
|
||||||
label: 'Alasan Penolakan',
|
|
||||||
value: item.alasanPenolakan!,
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
),
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
// Content
|
||||||
children: [
|
Padding(
|
||||||
TextButton.icon(
|
padding: const EdgeInsets.all(16),
|
||||||
onPressed: () {
|
child: Column(
|
||||||
_showDetailDialog(context, item, donaturNama);
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
},
|
children: [
|
||||||
icon: const Icon(Icons.info_outline, size: 18),
|
// Donatur info
|
||||||
label: const Text('Detail'),
|
Row(
|
||||||
style: TextButton.styleFrom(
|
children: [
|
||||||
foregroundColor: Colors.blue,
|
CircleAvatar(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
backgroundColor: AppTheme.primaryColor.withOpacity(0.1),
|
||||||
|
radius: 20,
|
||||||
|
child: Text(
|
||||||
|
donaturNama.isNotEmpty
|
||||||
|
? donaturNama.substring(0, 1).toUpperCase()
|
||||||
|
: '?',
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppTheme.primaryColor,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 12),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
donaturNama,
|
||||||
|
style: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.titleMedium
|
||||||
|
?.copyWith(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Donatur',
|
||||||
|
style: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.bodySmall
|
||||||
|
?.copyWith(
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
const Divider(),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
|
||||||
|
// Informasi bantuan
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.all(12),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: isUang
|
||||||
|
? Colors.green.withOpacity(0.1)
|
||||||
|
: Colors.blue.withOpacity(0.1),
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
isUang
|
||||||
|
? Icons.monetization_on
|
||||||
|
: Icons.category,
|
||||||
|
size: 16,
|
||||||
|
color: isUang ? Colors.green : Colors.blue,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 6),
|
||||||
|
Text(
|
||||||
|
'Kategori',
|
||||||
|
style: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.bodySmall
|
||||||
|
?.copyWith(
|
||||||
|
color: isUang
|
||||||
|
? Colors.green
|
||||||
|
: Colors.blue,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
Text(
|
||||||
|
kategoriNama,
|
||||||
|
style: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.titleSmall
|
||||||
|
?.copyWith(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 12),
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.all(12),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: isUang
|
||||||
|
? Colors.amber.withOpacity(0.1)
|
||||||
|
: Colors.purple.withOpacity(0.1),
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
isUang
|
||||||
|
? Icons.account_balance_wallet
|
||||||
|
: Icons.inventory,
|
||||||
|
size: 16,
|
||||||
|
color: isUang
|
||||||
|
? Colors.amber.shade800
|
||||||
|
: Colors.purple,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 6),
|
||||||
|
Text(
|
||||||
|
'Jumlah',
|
||||||
|
style: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.bodySmall
|
||||||
|
?.copyWith(
|
||||||
|
color: isUang
|
||||||
|
? Colors.amber.shade800
|
||||||
|
: Colors.purple,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
Text(
|
||||||
|
isUang
|
||||||
|
? 'Rp ${DateTimeHelper.formatNumber(item.jumlah)}'
|
||||||
|
: '${DateTimeHelper.formatNumber(item.jumlah)} $kategoriSatuan',
|
||||||
|
style: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.titleSmall
|
||||||
|
?.copyWith(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
|
||||||
|
// Verifikasi info
|
||||||
|
if (item.status == 'TERVERIFIKASI' &&
|
||||||
|
item.petugasDesaId != null)
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
const Divider(),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Icons.verified_user,
|
||||||
|
size: 16,
|
||||||
|
color: Colors.green,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 6),
|
||||||
|
Expanded(
|
||||||
|
child: RichText(
|
||||||
|
text: TextSpan(
|
||||||
|
style: Theme.of(context).textTheme.bodyMedium,
|
||||||
|
children: [
|
||||||
|
TextSpan(
|
||||||
|
text: 'Diverifikasi oleh ',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.grey.shade700),
|
||||||
|
),
|
||||||
|
TextSpan(
|
||||||
|
text: controller.getPetugasDesaNama(
|
||||||
|
item.petugasDesaId),
|
||||||
|
style: const TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.green,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
|
||||||
|
// Alasan penolakan jika ditolak
|
||||||
|
if (item.status == 'DITOLAK' &&
|
||||||
|
item.alasanPenolakan != null &&
|
||||||
|
item.alasanPenolakan!.isNotEmpty)
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
const Divider(),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Icons.info_outline,
|
||||||
|
size: 16,
|
||||||
|
color: Colors.red,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 6),
|
||||||
|
Text(
|
||||||
|
'Alasan Penolakan',
|
||||||
|
style: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.bodyMedium
|
||||||
|
?.copyWith(
|
||||||
|
color: Colors.red,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
Text(
|
||||||
|
item.alasanPenolakan!,
|
||||||
|
style: Theme.of(context).textTheme.bodyMedium,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
// Footer dengan tombol aksi
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.grey.shade50,
|
||||||
|
border: Border(
|
||||||
|
top: BorderSide(color: Colors.grey.shade200),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
ElevatedButton.icon(
|
||||||
|
onPressed: () {
|
||||||
|
_showDetailDialog(context, item, donaturNama);
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.info_outline, size: 16),
|
||||||
|
label: const Text('Lihat Detail'),
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
backgroundColor: Colors.blue,
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 16, vertical: 8),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -360,42 +557,6 @@ class RiwayatPenitipanView extends GetView<PenitipanBantuanController> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildItemDetail(
|
|
||||||
BuildContext context, {
|
|
||||||
required IconData icon,
|
|
||||||
required String label,
|
|
||||||
required String value,
|
|
||||||
}) {
|
|
||||||
return Row(
|
|
||||||
children: [
|
|
||||||
Icon(
|
|
||||||
icon,
|
|
||||||
size: 16,
|
|
||||||
color: Colors.grey,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 4),
|
|
||||||
Expanded(
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
label,
|
|
||||||
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
|
||||||
color: Colors.grey,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
value,
|
|
||||||
style: Theme.of(context).textTheme.bodyMedium,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _showDetailDialog(
|
void _showDetailDialog(
|
||||||
BuildContext context, PenitipanBantuanModel item, String donaturNama) {
|
BuildContext context, PenitipanBantuanModel item, String donaturNama) {
|
||||||
final kategoriNama = item.kategoriBantuan?.nama ??
|
final kategoriNama = item.kategoriBantuan?.nama ??
|
||||||
|
@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:penyaluran_app/app/data/models/penyaluran_bantuan_model.dart';
|
import 'package:penyaluran_app/app/data/models/penyaluran_bantuan_model.dart';
|
||||||
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/jadwal_penyaluran_controller.dart';
|
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/jadwal_penyaluran_controller.dart';
|
||||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
import 'package:penyaluran_app/app/utils/format_helper.dart';
|
||||||
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
||||||
|
|
||||||
class RiwayatPenyaluranView extends GetView<JadwalPenyaluranController> {
|
class RiwayatPenyaluranView extends GetView<JadwalPenyaluranController> {
|
||||||
|
@ -4,7 +4,7 @@ import 'package:penyaluran_app/app/data/models/riwayat_stok_model.dart';
|
|||||||
import 'package:penyaluran_app/app/data/models/stok_bantuan_model.dart';
|
import 'package:penyaluran_app/app/data/models/stok_bantuan_model.dart';
|
||||||
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/riwayat_stok_controller.dart';
|
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/riwayat_stok_controller.dart';
|
||||||
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
||||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
import 'package:penyaluran_app/app/utils/format_helper.dart';
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
|
|
||||||
class RiwayatStokView extends GetView<RiwayatStokController> {
|
class RiwayatStokView extends GetView<RiwayatStokController> {
|
||||||
@ -60,60 +60,6 @@ class RiwayatStokView extends GetView<RiwayatStokController> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
// Header dengan latar belakang gradient
|
|
||||||
Container(
|
|
||||||
padding: const EdgeInsets.all(20.0),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
gradient: AppTheme.primaryGradient,
|
|
||||||
borderRadius: const BorderRadius.only(
|
|
||||||
bottomLeft: Radius.circular(20),
|
|
||||||
bottomRight: Radius.circular(20),
|
|
||||||
),
|
|
||||||
boxShadow: [
|
|
||||||
BoxShadow(
|
|
||||||
color: Colors.black.withOpacity(0.1),
|
|
||||||
blurRadius: 10,
|
|
||||||
spreadRadius: 1,
|
|
||||||
offset: const Offset(0, 3),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
// Heading
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
const Icon(
|
|
||||||
Icons.inventory_2_outlined,
|
|
||||||
color: Colors.white,
|
|
||||||
size: 30,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 10),
|
|
||||||
Text(
|
|
||||||
'Riwayat Stok Bantuan',
|
|
||||||
style:
|
|
||||||
Theme.of(context).textTheme.headlineSmall?.copyWith(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(height: 8),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 40),
|
|
||||||
child: Text(
|
|
||||||
'Catatan perubahan stok bantuan di desa Anda',
|
|
||||||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
|
||||||
color: Colors.white.withOpacity(0.9),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
// Filter dan pencarian
|
// Filter dan pencarian
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
@ -3,7 +3,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:penyaluran_app/app/data/models/stok_bantuan_model.dart';
|
import 'package:penyaluran_app/app/data/models/stok_bantuan_model.dart';
|
||||||
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/stok_bantuan_controller.dart';
|
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/stok_bantuan_controller.dart';
|
||||||
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
||||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
import 'package:penyaluran_app/app/utils/format_helper.dart';
|
||||||
|
|
||||||
class StokBantuanView extends GetView<StokBantuanController> {
|
class StokBantuanView extends GetView<StokBantuanController> {
|
||||||
const StokBantuanView({super.key});
|
const StokBantuanView({super.key});
|
||||||
@ -17,13 +17,15 @@ class StokBantuanView extends GetView<StokBantuanController> {
|
|||||||
? const Center(child: CircularProgressIndicator())
|
? const Center(child: CircularProgressIndicator())
|
||||||
: _buildContent(context)),
|
: _buildContent(context)),
|
||||||
),
|
),
|
||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton.extended(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
// Tampilkan dialog tambah stok bantuan
|
// Tampilkan dialog tambah stok bantuan
|
||||||
_showAddStokDialog(context);
|
_showAddStokDialog(context);
|
||||||
},
|
},
|
||||||
backgroundColor: AppTheme.primaryColor,
|
backgroundColor: AppTheme.primaryColor,
|
||||||
child: const Icon(Icons.add, color: Colors.white),
|
icon: const Icon(Icons.add, color: Colors.white),
|
||||||
|
label: const Text('Tambah Stok', style: TextStyle(color: Colors.white)),
|
||||||
|
elevation: 2,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/jadwal_penyaluran_controller.dart';
|
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/jadwal_penyaluran_controller.dart';
|
||||||
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
||||||
import 'package:penyaluran_app/app/data/models/skema_bantuan_model.dart';
|
import 'package:penyaluran_app/app/data/models/skema_bantuan_model.dart';
|
||||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
import 'package:penyaluran_app/app/utils/format_helper.dart';
|
||||||
|
|
||||||
class TambahPenyaluranView extends GetView<JadwalPenyaluranController> {
|
class TambahPenyaluranView extends GetView<JadwalPenyaluranController> {
|
||||||
const TambahPenyaluranView({super.key});
|
const TambahPenyaluranView({super.key});
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -2,11 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:penyaluran_app/app/modules/warga/controllers/warga_dashboard_controller.dart';
|
import 'package:penyaluran_app/app/modules/warga/controllers/warga_dashboard_controller.dart';
|
||||||
import 'package:penyaluran_app/app/routes/app_pages.dart';
|
|
||||||
import 'package:penyaluran_app/app/widgets/bantuan_card.dart';
|
|
||||||
import 'package:penyaluran_app/app/widgets/section_header.dart';
|
import 'package:penyaluran_app/app/widgets/section_header.dart';
|
||||||
import 'package:penyaluran_app/app/data/models/penerima_penyaluran_model.dart';
|
|
||||||
import 'package:penyaluran_app/app/modules/warga/views/form_pengaduan_view.dart';
|
|
||||||
|
|
||||||
class WargaDashboardView extends GetView<WargaDashboardController> {
|
class WargaDashboardView extends GetView<WargaDashboardController> {
|
||||||
const WargaDashboardView({super.key});
|
const WargaDashboardView({super.key});
|
||||||
@ -32,8 +28,6 @@ class WargaDashboardView extends GetView<WargaDashboardController> {
|
|||||||
_buildStatisticSection(),
|
_buildStatisticSection(),
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
_buildPenerimaanSummary(),
|
_buildPenerimaanSummary(),
|
||||||
const SizedBox(height: 24),
|
|
||||||
_buildRecentPenerimaan(),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -588,285 +582,4 @@ class WargaDashboardView extends GetView<WargaDashboardController> {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildRecentPenerimaan() {
|
|
||||||
if (controller.penerimaPenyaluran.isEmpty) {
|
|
||||||
return Container(
|
|
||||||
padding: const EdgeInsets.all(20),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.grey.shade50,
|
|
||||||
borderRadius: BorderRadius.circular(16),
|
|
||||||
),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
SectionHeader(
|
|
||||||
title: 'Bantuan Terbaru',
|
|
||||||
titleStyle: TextStyle(
|
|
||||||
fontSize: 18,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color: Colors.blue.shade800,
|
|
||||||
),
|
|
||||||
padding: EdgeInsets.zero,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 20),
|
|
||||||
Container(
|
|
||||||
padding: const EdgeInsets.all(20),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.white,
|
|
||||||
borderRadius: BorderRadius.circular(16),
|
|
||||||
border: Border.all(color: Colors.grey.shade200),
|
|
||||||
),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Icon(
|
|
||||||
Icons.info_outline,
|
|
||||||
size: 48,
|
|
||||||
color: Colors.grey.shade400,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 16),
|
|
||||||
Text(
|
|
||||||
'Belum Ada Bantuan',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color: Colors.grey.shade700,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 8),
|
|
||||||
Text(
|
|
||||||
'Data bantuan akan muncul di sini ketika Anda menerima bantuan.',
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14,
|
|
||||||
color: Colors.grey.shade600,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
final maxItems = controller.penerimaPenyaluran.length > 2
|
|
||||||
? 2
|
|
||||||
: controller.penerimaPenyaluran.length;
|
|
||||||
|
|
||||||
return Container(
|
|
||||||
padding: const EdgeInsets.all(20),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.grey.shade50,
|
|
||||||
borderRadius: BorderRadius.circular(16),
|
|
||||||
boxShadow: [
|
|
||||||
BoxShadow(
|
|
||||||
color: Colors.grey.withOpacity(0.05),
|
|
||||||
blurRadius: 10,
|
|
||||||
offset: const Offset(0, 5),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
SectionHeader(
|
|
||||||
title: 'Bantuan Terbaru',
|
|
||||||
viewAllText: 'Lihat Semua',
|
|
||||||
onViewAll: () {
|
|
||||||
Get.toNamed(Routes.wargaPenerimaan);
|
|
||||||
},
|
|
||||||
titleStyle: TextStyle(
|
|
||||||
fontSize: 18,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color: Colors.blue.shade800,
|
|
||||||
),
|
|
||||||
padding: EdgeInsets.zero,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 16),
|
|
||||||
ListView.builder(
|
|
||||||
shrinkWrap: true,
|
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
|
||||||
itemCount: maxItems,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
final item = controller.penerimaPenyaluran[index];
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.only(bottom: 16),
|
|
||||||
child: BantuanCard(
|
|
||||||
item: item,
|
|
||||||
isCompact: true,
|
|
||||||
onTap: () {
|
|
||||||
Get.toNamed('/warga/detail-penerimaan',
|
|
||||||
arguments: {'id': item.id});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
if (controller.penerimaPenyaluran.length > 2)
|
|
||||||
Center(
|
|
||||||
child: ElevatedButton.icon(
|
|
||||||
onPressed: () {
|
|
||||||
Get.toNamed(Routes.wargaPenerimaan);
|
|
||||||
},
|
|
||||||
icon: const Icon(Icons.list),
|
|
||||||
label: const Text('Lihat Semua Bantuan'),
|
|
||||||
style: ElevatedButton.styleFrom(
|
|
||||||
foregroundColor: Colors.white,
|
|
||||||
backgroundColor: Colors.blue,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
),
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 16,
|
|
||||||
vertical: 10,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _showBuatPengaduanDialog(BuildContext context) {
|
|
||||||
// Daftar penerimaan bantuan yang dapat diadukan (status DITERIMA)
|
|
||||||
final bantuanDiterima = controller.penerimaPenyaluran
|
|
||||||
.where((item) => item.statusPenerimaan == 'DITERIMA')
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
// Jika tidak ada bantuan yang diterima
|
|
||||||
if (bantuanDiterima.isEmpty) {
|
|
||||||
Get.snackbar(
|
|
||||||
'Informasi',
|
|
||||||
'Tidak ada bantuan yang sudah diterima untuk dapat diajukan pengaduan',
|
|
||||||
snackPosition: SnackPosition.BOTTOM,
|
|
||||||
backgroundColor: Colors.orange,
|
|
||||||
colorText: Colors.white,
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Variabel untuk menyimpan pilihan penerimaan
|
|
||||||
PenerimaPenyaluranModel? selectedPenerimaan = bantuanDiterima.first;
|
|
||||||
|
|
||||||
Get.dialog(
|
|
||||||
Dialog(
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(16),
|
|
||||||
),
|
|
||||||
child: Container(
|
|
||||||
width: double.infinity,
|
|
||||||
padding: const EdgeInsets.all(20),
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Icon(
|
|
||||||
Icons.report_problem,
|
|
||||||
color: Colors.orange.shade700,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 10),
|
|
||||||
const Text(
|
|
||||||
'Buat Pengaduan Baru',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 18,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
IconButton(
|
|
||||||
icon: const Icon(Icons.close),
|
|
||||||
onPressed: () => Get.back(),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(height: 20),
|
|
||||||
const Text(
|
|
||||||
'Pilih Bantuan yang Ingin Diadukan:',
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 16,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
StatefulBuilder(
|
|
||||||
builder: (context, setState) {
|
|
||||||
return Container(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
border: Border.all(color: Colors.grey.shade300),
|
|
||||||
),
|
|
||||||
child: DropdownButtonHideUnderline(
|
|
||||||
child: DropdownButton<PenerimaPenyaluranModel>(
|
|
||||||
isExpanded: true,
|
|
||||||
value: selectedPenerimaan,
|
|
||||||
items: bantuanDiterima.map((item) {
|
|
||||||
String displayText = item.namaPenyaluran ?? 'Bantuan';
|
|
||||||
if (item.tanggalPenerimaan != null) {
|
|
||||||
displayText +=
|
|
||||||
' (${DateFormat('dd/MM/yyyy').format(item.tanggalPenerimaan!)})';
|
|
||||||
}
|
|
||||||
|
|
||||||
return DropdownMenuItem<PenerimaPenyaluranModel>(
|
|
||||||
value: item,
|
|
||||||
child: Text(displayText),
|
|
||||||
);
|
|
||||||
}).toList(),
|
|
||||||
onChanged: (value) {
|
|
||||||
if (value != null) {
|
|
||||||
setState(() {
|
|
||||||
selectedPenerimaan = value;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(height: 24),
|
|
||||||
SizedBox(
|
|
||||||
width: double.infinity,
|
|
||||||
child: ElevatedButton(
|
|
||||||
onPressed: () {
|
|
||||||
if (selectedPenerimaan != null) {
|
|
||||||
Get.back();
|
|
||||||
Get.to(
|
|
||||||
() => FormPengaduanView(
|
|
||||||
uidPenerimaan: selectedPenerimaan!.id.toString(),
|
|
||||||
),
|
|
||||||
transition: Transition.rightToLeft,
|
|
||||||
duration: const Duration(milliseconds: 300),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
style: ElevatedButton.styleFrom(
|
|
||||||
backgroundColor: Colors.orange.shade700,
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: const Text(
|
|
||||||
'Lanjutkan',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ import 'package:intl/intl.dart';
|
|||||||
import 'package:penyaluran_app/app/data/models/penerima_penyaluran_model.dart';
|
import 'package:penyaluran_app/app/data/models/penerima_penyaluran_model.dart';
|
||||||
import 'package:penyaluran_app/app/modules/warga/controllers/warga_dashboard_controller.dart';
|
import 'package:penyaluran_app/app/modules/warga/controllers/warga_dashboard_controller.dart';
|
||||||
import 'package:penyaluran_app/app/modules/warga/views/form_pengaduan_view.dart';
|
import 'package:penyaluran_app/app/modules/warga/views/form_pengaduan_view.dart';
|
||||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
import 'package:penyaluran_app/app/utils/format_helper.dart';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'package:image_picker/image_picker.dart';
|
import 'package:image_picker/image_picker.dart';
|
||||||
|
|
||||||
|
@ -14,19 +14,6 @@ class WargaView extends GetView<WargaDashboardController> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
// Tambahkan listener untuk refresh data saat fokus didapatkan kembali
|
|
||||||
// misalnya ketika kembali dari halaman profil
|
|
||||||
// WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
||||||
// final focusNode = FocusNode();
|
|
||||||
// FocusScope.of(context).requestFocus(focusNode);
|
|
||||||
// focusNode.addListener(() {
|
|
||||||
// if (focusNode.hasFocus) {
|
|
||||||
// print('DEBUG WARGA: Halaman mendapatkan fokus, memuat ulang data');
|
|
||||||
// controller.refreshData();
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
key: scaffoldKey,
|
key: scaffoldKey,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
@ -288,9 +275,6 @@ class WargaView extends GetView<WargaDashboardController> {
|
|||||||
activeIcon: Icons.report_problem,
|
activeIcon: Icons.report_problem,
|
||||||
title: 'Pengaduan',
|
title: 'Pengaduan',
|
||||||
isSelected: controller.activeTabIndex.value == 2,
|
isSelected: controller.activeTabIndex.value == 2,
|
||||||
badge: controller.totalPengaduanProses.value > 0
|
|
||||||
? controller.totalPengaduanProses.value.toString()
|
|
||||||
: null,
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
controller.changeTab(2);
|
controller.changeTab(2);
|
||||||
|
@ -39,6 +39,7 @@ import 'package:penyaluran_app/app/modules/laporan_penyaluran/views/laporan_peny
|
|||||||
import 'package:penyaluran_app/app/modules/laporan_penyaluran/bindings/laporan_penyaluran_binding.dart';
|
import 'package:penyaluran_app/app/modules/laporan_penyaluran/bindings/laporan_penyaluran_binding.dart';
|
||||||
import 'package:penyaluran_app/app/modules/donatur/views/donatur_view.dart';
|
import 'package:penyaluran_app/app/modules/donatur/views/donatur_view.dart';
|
||||||
import 'package:penyaluran_app/app/modules/donatur/controllers/donatur_dashboard_controller.dart';
|
import 'package:penyaluran_app/app/modules/donatur/controllers/donatur_dashboard_controller.dart';
|
||||||
|
import 'package:penyaluran_app/app/modules/donatur/views/donatur_jadwal_detail_view.dart';
|
||||||
|
|
||||||
part 'app_routes.dart';
|
part 'app_routes.dart';
|
||||||
|
|
||||||
@ -239,5 +240,10 @@ class AppPages {
|
|||||||
},
|
},
|
||||||
binding: DonaturBinding(),
|
binding: DonaturBinding(),
|
||||||
),
|
),
|
||||||
|
GetPage(
|
||||||
|
name: '/donatur/jadwal/:id',
|
||||||
|
page: () => const DonaturJadwalDetailView(),
|
||||||
|
binding: DonaturBinding(),
|
||||||
|
),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
43
lib/app/utils/date_helper.dart
Normal file
43
lib/app/utils/date_helper.dart
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
|
/// Kelas pembantu untuk manipulasi tanggal dan waktu
|
||||||
|
class DateHelper {
|
||||||
|
/// Format tanggal ke format Indonesia (dd MMM yyyy)
|
||||||
|
static String formatDate(
|
||||||
|
DateTime? dateTime, {
|
||||||
|
String format = 'dd MMM yyyy',
|
||||||
|
String locale = 'id_ID',
|
||||||
|
String defaultValue = 'Belum ditentukan',
|
||||||
|
}) {
|
||||||
|
if (dateTime == null) return defaultValue;
|
||||||
|
try {
|
||||||
|
return DateFormat(format, locale).format(dateTime.toLocal());
|
||||||
|
} catch (e) {
|
||||||
|
return dateTime.toString().split(' ')[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Format nilai ke dalam format mata uang Rupiah
|
||||||
|
static String formatRupiah(
|
||||||
|
num? value, {
|
||||||
|
String symbol = 'Rp',
|
||||||
|
int decimalDigits = 0,
|
||||||
|
String defaultValue = 'Rp 0',
|
||||||
|
}) {
|
||||||
|
if (value == null) return defaultValue;
|
||||||
|
try {
|
||||||
|
final formatter = NumberFormat.currency(
|
||||||
|
locale: 'id_ID',
|
||||||
|
symbol: '$symbol ',
|
||||||
|
decimalDigits: decimalDigits,
|
||||||
|
);
|
||||||
|
return formatter.format(value);
|
||||||
|
} catch (e) {
|
||||||
|
// Format manual
|
||||||
|
return '$symbol ${value.toStringAsFixed(decimalDigits).replaceAllMapped(
|
||||||
|
RegExp(r'(\d{1,3})(?=(\d{3})+(?!\d))'),
|
||||||
|
(Match m) => '${m[1]}.',
|
||||||
|
)}';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -219,4 +219,34 @@ class DateTimeHelper {
|
|||||||
final localDateTime = toLocalDateTime(dateTime);
|
final localDateTime = toLocalDateTime(dateTime);
|
||||||
return DateFormat('dd MMMM yyyy HH:mm', 'id_ID').format(localDateTime);
|
return DateFormat('dd MMMM yyyy HH:mm', 'id_ID').format(localDateTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Format nilai ke dalam format mata uang Rupiah
|
||||||
|
///
|
||||||
|
/// [value] adalah nilai yang akan diformat
|
||||||
|
/// [symbol] adalah simbol mata uang (default: 'Rp')
|
||||||
|
/// [decimalDigits] adalah jumlah digit desimal yang ditampilkan
|
||||||
|
/// [defaultValue] adalah nilai default jika value null
|
||||||
|
static String formatRupiah(
|
||||||
|
num? value, {
|
||||||
|
String symbol = 'Rp',
|
||||||
|
int decimalDigits = 0,
|
||||||
|
String defaultValue = 'Rp 0',
|
||||||
|
}) {
|
||||||
|
if (value == null) return defaultValue;
|
||||||
|
try {
|
||||||
|
final formatter = NumberFormat.currency(
|
||||||
|
locale: 'id_ID',
|
||||||
|
symbol: '$symbol ',
|
||||||
|
decimalDigits: decimalDigits,
|
||||||
|
);
|
||||||
|
return formatter.format(value);
|
||||||
|
} catch (e) {
|
||||||
|
print('Error formatting currency: $e');
|
||||||
|
// Fallback ke format manual
|
||||||
|
return '$symbol ${value.toStringAsFixed(decimalDigits).replaceAllMapped(
|
||||||
|
RegExp(r'(\d{1,3})(?=(\d{3})+(?!\d))'),
|
||||||
|
(Match m) => '${m[1]}.',
|
||||||
|
)}';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:penyaluran_app/app/data/models/penitipan_bantuan_model.dart';
|
import 'package:penyaluran_app/app/data/models/penitipan_bantuan_model.dart';
|
||||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
import 'package:penyaluran_app/app/utils/format_helper.dart';
|
||||||
import 'package:penyaluran_app/app/theme/app_colors.dart';
|
import 'package:penyaluran_app/app/theme/app_colors.dart';
|
||||||
|
|
||||||
/// Dialog untuk menampilkan detail penitipan bantuan
|
/// Dialog untuk menampilkan detail penitipan bantuan
|
||||||
|
Reference in New Issue
Block a user