From 368145fc77258787a3b9208ad9048a1afc8acb68 Mon Sep 17 00:00:00 2001 From: Novian Andika Date: Tue, 7 Feb 2023 15:48:11 +0700 Subject: [PATCH 1/2] feat: detail agunan done for reviewer --- .../agunan_pilih/views/agunan_pilih_view.dart | 2579 ++++++++--------- .../bindings/detail_agunan_binding.dart | 12 + .../controllers/detail_agunan_controller.dart | 9 + .../views/detail_agunan_view.dart | 2140 ++++++++++++++ .../reviewer_submit_controller.dart | 10 +- .../views/reviewer_submit_view.dart | 54 +- lib/app/routes/app_pages.dart | 7 + lib/app/routes/app_routes.dart | 2 + 8 files changed, 3476 insertions(+), 1337 deletions(-) create mode 100644 lib/app/modules/detail_agunan/bindings/detail_agunan_binding.dart create mode 100644 lib/app/modules/detail_agunan/controllers/detail_agunan_controller.dart create mode 100644 lib/app/modules/detail_agunan/views/detail_agunan_view.dart diff --git a/lib/app/modules/agunan_pilih/views/agunan_pilih_view.dart b/lib/app/modules/agunan_pilih/views/agunan_pilih_view.dart index 66257550..15e9f2d5 100644 --- a/lib/app/modules/agunan_pilih/views/agunan_pilih_view.dart +++ b/lib/app/modules/agunan_pilih/views/agunan_pilih_view.dart @@ -40,223 +40,195 @@ class AgunanPilihView extends GetView { appBar: AppBar( title: const Text('Pilih Jenis Agunan'), ), - body: FormBuilder( - key: controller.formKey, - skipDisabled: true, - onChanged: () { - controller.formKey.currentState!.save(); - debugPrint(controller.formKey.currentState!.value.toString()); - }, - child: Container( - padding: const EdgeInsets.all(16), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // Check plafon kredit if <= then go to agunan lainnya - Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Animate( - child: SizedBox( - height: 200, - child: Center( - child: Image.asset( - 'assets/images/home/bannerr.png', - fit: BoxFit.cover, - alignment: Alignment.center, - height: 200, - ) - .animate() - .fadeIn() // uses `Animate.defaultDuration` - .scale() // inherits duration from fadeIn - .move(delay: 300.ms, duration: 600.ms), - ), - ) // runs after the above w/new duration - // inherits the delay & duration from move, - ), - const SizedBox( - height: 12.0, - ), - FormBuilderTextField( - name: 'plafon_kredit', - readOnly: true, - controller: controller.plafonKredit = - MoneyMaskedTextController( - decimalSeparator: '', - thousandSeparator: '.', - precision: 0, - initialValue: double.parse( - data.inputKeuangan.kreditDiusulkan, + body: SingleChildScrollView( + child: FormBuilder( + key: controller.formKey, + skipDisabled: true, + onChanged: () { + controller.formKey.currentState!.save(); + debugPrint(controller.formKey.currentState!.value.toString()); + }, + child: Container( + padding: const EdgeInsets.all(16), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Check plafon kredit if <= then go to agunan lainnya + Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Animate( + child: SizedBox( + height: 200, + child: Center( + child: Image.asset( + 'assets/images/home/bannerr.png', + fit: BoxFit.cover, + alignment: Alignment.center, + height: 200, + ) + .animate() + .fadeIn() // uses `Animate.defaultDuration` + .scale() // inherits duration from fadeIn + .move(delay: 300.ms, duration: 600.ms), ), + ) // runs after the above w/new duration + // inherits the delay & duration from move, + ), + const SizedBox( + height: 12.0, ), - decoration: const InputDecoration( - labelText: 'Plafon Kredit', - prefixText: 'Rp. ', - alignLabelWithHint: true, - border: OutlineInputBorder( - borderRadius: BorderRadius.all( - Radius.circular(8), + FormBuilderTextField( + name: 'plafon_kredit', + readOnly: true, + controller: controller.plafonKredit = + MoneyMaskedTextController( + decimalSeparator: '', + thousandSeparator: '.', + precision: 0, + initialValue: double.parse( + data.inputKeuangan.kreditDiusulkan, + ), + ), + decoration: const InputDecoration( + labelText: 'Plafon Kredit', + prefixText: 'Rp. ', + alignLabelWithHint: true, + border: OutlineInputBorder( + borderRadius: BorderRadius.all( + Radius.circular(8), + ), ), ), ), - ), - const SizedBox( - height: 30, - ), - int.parse(data.inputKeuangan.kreditDiusulkan) > 100000000 - ? Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - 'Berikut adalah jenis agunan yang tersedia untuk plafond diatas Rp. 100.000.000', - style: Theme.of(context) - .textTheme - .bodySmall - ?.merge(const TextStyle(fontSize: 14)), - ), - const SizedBox( - height: 16.0, - ), - Obx( - () => controller.isAgunanInputProcessing.value - ? const Center( - child: Align( - alignment: Alignment.bottomCenter, - child: CircularProgressIndicator(), - ), - ) - : Column( - children: [ - const SizedBox( - height: 12.0, + const SizedBox( + height: 30, + ), + int.parse(data.inputKeuangan.kreditDiusulkan) > 100000000 + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Berikut adalah jenis agunan yang tersedia untuk plafond diatas Rp. 100.000.000', + style: Theme.of(context) + .textTheme + .bodySmall + ?.merge(const TextStyle(fontSize: 14)), + ), + const SizedBox( + height: 16.0, + ), + Obx( + () => controller.isAgunanInputProcessing.value + ? const Center( + child: Align( + alignment: Alignment.bottomCenter, + child: CircularProgressIndicator(), ), - Row( - children: [ - Expanded( - child: Slidable( - enabled: controller - .debiturController - .insightDebitur - .value - .agunan - ?.where((element) => - element - .kodeAgunan == - 1) - .isEmpty == - true - ? false - : true, - endActionPane: ActionPane( - motion: const DrawerMotion(), - children: [ - SlidableAction( - borderRadius: - BorderRadius.circular( - 20), - padding: - const EdgeInsets.all( - 10), - spacing: 10, - onPressed: ((context) => { - AwesomeDialog( - context: Get - .context!, - dialogType: DialogType - .question, - animType: AnimType - .bottomSlide, - dialogBackgroundColor: - primaryColor, - titleTextStyle: - GoogleFonts - .poppins( - color: - secondaryColor, - fontSize: - 30, - fontWeight: - FontWeight - .w500, - ), - descTextStyle: - GoogleFonts - .poppins( - color: - secondaryColor, - fontSize: - 18, - fontWeight: - FontWeight - .w400, - ), - title: - 'Konfirmasi', - bodyHeaderDistance: - 25, - desc: - 'Apakah yakin untuk menghapus item ini ?', - btnOkOnPress: - () { - controller.deleteFirstAgunan( - controller - .debiturController - .insightDebitur - .value - .agunan! - .firstWhere((element) => element.kodeAgunan == 1) - .id!, - 'agunan_tanah'); - }, - btnOkText: - 'Oke sip', - btnCancelText: - 'Affa iyh', - btnCancelOnPress: - () {}) - .show() - }), - backgroundColor: - GFColors.DANGER, - foregroundColor: - Colors.white, - icon: FontAwesomeIcons - .trash, - label: 'Hapus', - ), - ], - ), - child: Obx(() => controller - .isAgunanInputProcessing - .value - ? const Center( - child: - CircularProgressIndicator()) - : FormBuilderCheckbox( - name: 'agunan_tanah', - enabled: controller - .debiturController - .insightDebitur - .value - .agunan - ?.where((element) => - element - .kodeAgunan == - 1) - .isEmpty == - true - ? true - : false, - activeColor: - primaryColor, - decoration: - InputDecoration( - border: - const OutlineInputBorder(), - filled: true, - fillColor: controller + ) + : Column( + children: [ + const SizedBox( + height: 12.0, + ), + Row( + children: [ + Expanded( + child: Slidable( + enabled: controller + .debiturController + .insightDebitur + .value + .agunan + ?.where((element) => + element + .kodeAgunan == + 1) + .isEmpty == + true + ? false + : true, + endActionPane: ActionPane( + motion: + const DrawerMotion(), + children: [ + SlidableAction( + borderRadius: + BorderRadius + .circular(20), + padding: + const EdgeInsets + .all(10), + spacing: 10, + onPressed: + ((context) => { + AwesomeDialog( + context: Get + .context!, + dialogType: DialogType + .question, + animType: AnimType + .bottomSlide, + dialogBackgroundColor: + primaryColor, + titleTextStyle: GoogleFonts + .poppins( + color: + secondaryColor, + fontSize: + 30, + fontWeight: + FontWeight.w500, + ), + descTextStyle: GoogleFonts + .poppins( + color: + secondaryColor, + fontSize: + 18, + fontWeight: + FontWeight.w400, + ), + title: + 'Konfirmasi', + bodyHeaderDistance: + 25, + desc: + 'Apakah yakin untuk menghapus item ini ?', + btnOkOnPress: + () { + controller.deleteFirstAgunan(controller.debiturController.insightDebitur.value.agunan!.firstWhere((element) => element.kodeAgunan == 1).id!, + 'agunan_tanah'); + }, + btnOkText: + 'Oke sip', + btnCancelText: + 'Affa iyh', + btnCancelOnPress: + () {}) + .show() + }), + backgroundColor: + GFColors.DANGER, + foregroundColor: + Colors.white, + icon: FontAwesomeIcons + .trash, + label: 'Hapus', + ), + ], + ), + child: Obx(() => controller + .isAgunanInputProcessing + .value + ? const Center( + child: + CircularProgressIndicator()) + : FormBuilderCheckbox( + name: 'agunan_tanah', + enabled: controller .debiturController .insightDebitur .value @@ -267,176 +239,35 @@ class AgunanPilihView extends GetView { 1) .isEmpty == true - ? GFColors.FOCUS - : GFColors - .SUCCESS, - ), - title: Text( - 'Tanah', - style: checkboxStyle, - ), - initialValue: controller - .debiturController - .insightDebitur - .value - .agunan - ?.where((element) => - element - .kodeAgunan == - 1) - .isEmpty == - true - ? false - : controller + ? true + : false, + activeColor: + primaryColor, + decoration: + InputDecoration( + border: + const OutlineInputBorder(), + filled: true, + fillColor: controller .debiturController .insightDebitur .value .agunan - ?.contains( - controller - .debiturController - .insightDebitur - .value - .agunan! - .firstWhere( - (element) => + ?.where((element) => element.kodeAgunan == - 1, - ), - ) == + 1) + .isEmpty == true - ? true - : false, - )), - ), - ), - const SizedBox( - width: 12.0, - ), - Expanded( - child: Slidable( - enabled: controller - .debiturController - .insightDebitur - .value - .agunan - ?.where((element) => - element - .kodeAgunan == - 2) - .isEmpty == - true - ? false - : true, - startActionPane: ActionPane( - motion: const DrawerMotion(), - children: [ - SlidableAction( - borderRadius: - BorderRadius.circular( - 20), - padding: - const EdgeInsets.all( - 10), - spacing: 10, - onPressed: ((context) => { - AwesomeDialog( - context: Get - .context!, - dialogType: DialogType - .question, - animType: AnimType - .bottomSlide, - dialogBackgroundColor: - primaryColor, - titleTextStyle: - GoogleFonts - .poppins( - color: - secondaryColor, - fontSize: - 30, - fontWeight: - FontWeight - .w500, - ), - descTextStyle: - GoogleFonts - .poppins( - color: - secondaryColor, - fontSize: - 18, - fontWeight: - FontWeight - .w400, - ), - title: - 'Konfirmasi', - bodyHeaderDistance: - 25, - desc: - 'Apakah yakin untuk menghapus item ini ?', - btnOkOnPress: - () { - controller.deleteFirstAgunan( - controller - .debiturController - .insightDebitur - .value - .agunan! - .firstWhere((element) => element.kodeAgunan == 2) - .id!, - 'agunan_tanah'); - }, - btnOkText: - 'Oke sip', - btnCancelText: - 'Affa iyh', - btnCancelOnPress: - () {}) - .show() - }), - backgroundColor: - GFColors.DANGER, - foregroundColor: - Colors.white, - icon: FontAwesomeIcons - .trash, - label: 'Hapus', - ), - ], - ), - child: Obx(() => controller - .isAgunanInputProcessing - .value - ? const Center( - child: - CircularProgressIndicator()) - : FormBuilderCheckbox( - name: - 'agunan_tanah_bangunan', - activeColor: - primaryColor, - enabled: controller - .debiturController - .insightDebitur - .value - .agunan - ?.where((element) => - element - .kodeAgunan == - 2) - .isEmpty == - true - ? true - : false, - decoration: - InputDecoration( - border: - const OutlineInputBorder(), - filled: true, - fillColor: controller + ? GFColors.FOCUS + : GFColors + .SUCCESS, + ), + title: Text( + 'Tanah', + style: + checkboxStyle, + ), + initialValue: controller .debiturController .insightDebitur .value @@ -444,155 +275,122 @@ class AgunanPilihView extends GetView { ?.where((element) => element .kodeAgunan == - 2) + 1) .isEmpty == true - ? GFColors.FOCUS - : GFColors - .SUCCESS, - ), - title: Text( - 'Tanah dan Bangunan', - style: checkboxStyle, - ), - initialValue: controller - .debiturController - .insightDebitur - .value - .agunan - ?.where((element) => - element - .kodeAgunan == - 2) - .isEmpty == - true - ? false - : controller - .debiturController - .insightDebitur - .value - .agunan - ?.contains( - controller + ? false + : controller .debiturController .insightDebitur .value - .agunan! - .firstWhere( - (element) => - element.kodeAgunan == - 2, - ), - ) == - true - ? true - : false, - )), - ), - ), - ], - ), - const SizedBox( - height: 12.0, - ), - Row( - children: [ - Expanded( - child: Slidable( - enabled: controller - .debiturController - .insightDebitur - .value - .agunan - ?.where((element) => - element - .kodeAgunan == - 4) - .isEmpty == - true - ? false - : true, - endActionPane: ActionPane( - motion: const DrawerMotion(), - children: [ - SlidableAction( - borderRadius: - BorderRadius.circular( - 20), - padding: - const EdgeInsets.all( - 10), - spacing: 10, - onPressed: ((context) => { - AwesomeDialog( - context: Get - .context!, - dialogType: DialogType - .question, - animType: AnimType - .bottomSlide, - dialogBackgroundColor: - primaryColor, - titleTextStyle: - GoogleFonts - .poppins( - color: - secondaryColor, - fontSize: - 30, - fontWeight: - FontWeight - .w500, - ), - descTextStyle: - GoogleFonts - .poppins( - color: - secondaryColor, - fontSize: - 18, - fontWeight: - FontWeight - .w400, - ), - title: - 'Konfirmasi', - bodyHeaderDistance: - 25, - desc: - 'Apakah yakin untuk menghapus item ini ?', - btnOkOnPress: - () { - controller.deleteFirstAgunan( - controller - .debiturController - .insightDebitur - .value - .agunan! - .firstWhere((element) => element.kodeAgunan == 4) - .id!, - 'agunan_peralatan'); - }, - btnOkText: - 'Oke sip', - btnCancelText: - 'Affa iyh', - btnCancelOnPress: - () {}) - .show() - }), - backgroundColor: - GFColors.DANGER, - foregroundColor: - Colors.white, - icon: FontAwesomeIcons - .trash, - label: 'Hapus', - ), - ], + .agunan + ?.contains( + controller + .debiturController + .insightDebitur + .value + .agunan! + .firstWhere( + (element) => + element.kodeAgunan == + 1, + ), + ) == + true + ? true + : false, + )), ), - child: Obx( - () => controller + ), + const SizedBox( + width: 12.0, + ), + Expanded( + child: Slidable( + enabled: controller + .debiturController + .insightDebitur + .value + .agunan + ?.where((element) => + element + .kodeAgunan == + 2) + .isEmpty == + true + ? false + : true, + startActionPane: ActionPane( + motion: + const DrawerMotion(), + children: [ + SlidableAction( + borderRadius: + BorderRadius + .circular(20), + padding: + const EdgeInsets + .all(10), + spacing: 10, + onPressed: + ((context) => { + AwesomeDialog( + context: Get + .context!, + dialogType: DialogType + .question, + animType: AnimType + .bottomSlide, + dialogBackgroundColor: + primaryColor, + titleTextStyle: GoogleFonts + .poppins( + color: + secondaryColor, + fontSize: + 30, + fontWeight: + FontWeight.w500, + ), + descTextStyle: GoogleFonts + .poppins( + color: + secondaryColor, + fontSize: + 18, + fontWeight: + FontWeight.w400, + ), + title: + 'Konfirmasi', + bodyHeaderDistance: + 25, + desc: + 'Apakah yakin untuk menghapus item ini ?', + btnOkOnPress: + () { + controller.deleteFirstAgunan(controller.debiturController.insightDebitur.value.agunan!.firstWhere((element) => element.kodeAgunan == 2).id!, + 'agunan_tanah'); + }, + btnOkText: + 'Oke sip', + btnCancelText: + 'Affa iyh', + btnCancelOnPress: + () {}) + .show() + }), + backgroundColor: + GFColors.DANGER, + foregroundColor: + Colors.white, + icon: FontAwesomeIcons + .trash, + label: 'Hapus', + ), + ], + ), + child: Obx(() => controller .isAgunanInputProcessing .value ? const Center( @@ -600,7 +398,9 @@ class AgunanPilihView extends GetView { CircularProgressIndicator()) : FormBuilderCheckbox( name: - 'agunan_peralatan', + 'agunan_tanah_bangunan', + activeColor: + primaryColor, enabled: controller .debiturController .insightDebitur @@ -609,13 +409,11 @@ class AgunanPilihView extends GetView { ?.where((element) => element .kodeAgunan == - 4) + 2) .isEmpty == true ? true : false, - activeColor: - primaryColor, decoration: InputDecoration( border: @@ -628,7 +426,7 @@ class AgunanPilihView extends GetView { .agunan ?.where((element) => element.kodeAgunan == - 4) + 2) .isEmpty == true ? GFColors.FOCUS @@ -636,7 +434,7 @@ class AgunanPilihView extends GetView { .SUCCESS, ), title: Text( - 'Mesin dan Peralatan', + 'Tanah dan Bangunan', style: checkboxStyle, ), @@ -648,7 +446,7 @@ class AgunanPilihView extends GetView { ?.where((element) => element .kodeAgunan == - 4) + 2) .isEmpty == true ? false @@ -666,122 +464,463 @@ class AgunanPilihView extends GetView { .firstWhere( (element) => element.kodeAgunan == - 4, + 2, ), ) == true ? true : false, - ), + )), ), ), - ), - const SizedBox( - width: 12.0, - ), - Expanded( - child: Slidable( - enabled: controller - .debiturController - .insightDebitur + ], + ), + const SizedBox( + height: 12.0, + ), + Row( + children: [ + Expanded( + child: Slidable( + enabled: controller + .debiturController + .insightDebitur + .value + .agunan + ?.where((element) => + element + .kodeAgunan == + 4) + .isEmpty == + true + ? false + : true, + endActionPane: ActionPane( + motion: + const DrawerMotion(), + children: [ + SlidableAction( + borderRadius: + BorderRadius + .circular(20), + padding: + const EdgeInsets + .all(10), + spacing: 10, + onPressed: + ((context) => { + AwesomeDialog( + context: Get + .context!, + dialogType: DialogType + .question, + animType: AnimType + .bottomSlide, + dialogBackgroundColor: + primaryColor, + titleTextStyle: GoogleFonts + .poppins( + color: + secondaryColor, + fontSize: + 30, + fontWeight: + FontWeight.w500, + ), + descTextStyle: GoogleFonts + .poppins( + color: + secondaryColor, + fontSize: + 18, + fontWeight: + FontWeight.w400, + ), + title: + 'Konfirmasi', + bodyHeaderDistance: + 25, + desc: + 'Apakah yakin untuk menghapus item ini ?', + btnOkOnPress: + () { + controller.deleteFirstAgunan(controller.debiturController.insightDebitur.value.agunan!.firstWhere((element) => element.kodeAgunan == 4).id!, + 'agunan_peralatan'); + }, + btnOkText: + 'Oke sip', + btnCancelText: + 'Affa iyh', + btnCancelOnPress: + () {}) + .show() + }), + backgroundColor: + GFColors.DANGER, + foregroundColor: + Colors.white, + icon: FontAwesomeIcons + .trash, + label: 'Hapus', + ), + ], + ), + child: Obx( + () => controller + .isAgunanInputProcessing .value - .agunan - ?.where((element) => - element - .kodeAgunan == - 5) - .isEmpty == - true - ? false - : true, - startActionPane: ActionPane( - motion: const DrawerMotion(), - children: [ - SlidableAction( - borderRadius: - BorderRadius.circular( - 20), - padding: - const EdgeInsets.all( - 10), - spacing: 10, - onPressed: ((context) => { - AwesomeDialog( - context: Get - .context!, - dialogType: DialogType - .question, - animType: AnimType - .bottomSlide, - dialogBackgroundColor: - primaryColor, - titleTextStyle: - GoogleFonts - .poppins( - color: - secondaryColor, - fontSize: - 30, - fontWeight: - FontWeight - .w500, - ), - descTextStyle: - GoogleFonts - .poppins( - color: - secondaryColor, - fontSize: - 18, - fontWeight: - FontWeight - .w400, - ), - title: - 'Konfirmasi', - bodyHeaderDistance: - 25, - desc: - 'Apakah yakin untuk menghapus item ini ?', - btnOkOnPress: - () { - controller.deleteFirstAgunan( + ? const Center( + child: + CircularProgressIndicator()) + : FormBuilderCheckbox( + name: + 'agunan_peralatan', + enabled: controller + .debiturController + .insightDebitur + .value + .agunan + ?.where((element) => + element.kodeAgunan == + 4) + .isEmpty == + true + ? true + : false, + activeColor: + primaryColor, + decoration: + InputDecoration( + border: + const OutlineInputBorder(), + filled: true, + fillColor: controller + .debiturController + .insightDebitur + .value + .agunan + ?.where((element) => + element.kodeAgunan == + 4) + .isEmpty == + true + ? GFColors + .FOCUS + : GFColors + .SUCCESS, + ), + title: Text( + 'Mesin dan Peralatan', + style: + checkboxStyle, + ), + initialValue: controller + .debiturController + .insightDebitur + .value + .agunan + ?.where((element) => + element.kodeAgunan == + 4) + .isEmpty == + true + ? false + : controller + .debiturController + .insightDebitur + .value + .agunan + ?.contains( controller .debiturController .insightDebitur .value .agunan! - .firstWhere((element) => element.kodeAgunan == 5) - .id!, - 'agunan_cash'); - }, - btnOkText: - 'Oke sip', - btnCancelText: - 'Affa iyh', - btnCancelOnPress: - () {}) - .show() - }), - backgroundColor: - GFColors.DANGER, - foregroundColor: - Colors.white, - icon: FontAwesomeIcons - .trash, - label: 'Hapus', - ), - ], + .firstWhere( + (element) => + element.kodeAgunan == + 4, + ), + ) == + true + ? true + : false, + ), + ), ), - child: Obx( - () => controller + ), + const SizedBox( + width: 12.0, + ), + Expanded( + child: Slidable( + enabled: controller + .debiturController + .insightDebitur + .value + .agunan + ?.where((element) => + element + .kodeAgunan == + 5) + .isEmpty == + true + ? false + : true, + startActionPane: ActionPane( + motion: + const DrawerMotion(), + children: [ + SlidableAction( + borderRadius: + BorderRadius + .circular(20), + padding: + const EdgeInsets + .all(10), + spacing: 10, + onPressed: + ((context) => { + AwesomeDialog( + context: Get + .context!, + dialogType: DialogType + .question, + animType: AnimType + .bottomSlide, + dialogBackgroundColor: + primaryColor, + titleTextStyle: GoogleFonts + .poppins( + color: + secondaryColor, + fontSize: + 30, + fontWeight: + FontWeight.w500, + ), + descTextStyle: GoogleFonts + .poppins( + color: + secondaryColor, + fontSize: + 18, + fontWeight: + FontWeight.w400, + ), + title: + 'Konfirmasi', + bodyHeaderDistance: + 25, + desc: + 'Apakah yakin untuk menghapus item ini ?', + btnOkOnPress: + () { + controller.deleteFirstAgunan(controller.debiturController.insightDebitur.value.agunan!.firstWhere((element) => element.kodeAgunan == 5).id!, + 'agunan_cash'); + }, + btnOkText: + 'Oke sip', + btnCancelText: + 'Affa iyh', + btnCancelOnPress: + () {}) + .show() + }), + backgroundColor: + GFColors.DANGER, + foregroundColor: + Colors.white, + icon: FontAwesomeIcons + .trash, + label: 'Hapus', + ), + ], + ), + child: Obx( + () => controller + .isAgunanInputProcessing + .value + ? const Center( + child: + CircularProgressIndicator()) + : FormBuilderCheckbox( + name: 'agunan_cash', + enabled: controller + .debiturController + .insightDebitur + .value + .agunan + ?.where((element) => + element.kodeAgunan == + 5) + .isEmpty == + true + ? true + : false, + activeColor: + primaryColor, + decoration: + InputDecoration( + border: + const OutlineInputBorder(), + filled: true, + fillColor: controller + .debiturController + .insightDebitur + .value + .agunan + ?.where((element) => + element.kodeAgunan == + 5) + .isEmpty == + true + ? GFColors + .FOCUS + : GFColors + .SUCCESS, + ), + title: Text( + 'Cash Collateral', + style: + checkboxStyle, + ), + initialValue: controller + .debiturController + .insightDebitur + .value + .agunan + ?.where((element) => + element.kodeAgunan == + 5) + .isEmpty == + true + ? false + : controller + .debiturController + .insightDebitur + .value + .agunan + ?.contains( + controller + .debiturController + .insightDebitur + .value + .agunan! + .firstWhere( + (element) => + element.kodeAgunan == + 5, + ), + ) == + true + ? true + : false, + ), + ), + ), + ), + ], + ), + const SizedBox( + height: 12.0, + ), + Row( + children: [ + Expanded( + child: Slidable( + enabled: controller + .debiturController + .insightDebitur + .value + .agunan + ?.where((element) => + element + .kodeAgunan == + 6) + .isEmpty == + true + ? false + : true, + endActionPane: ActionPane( + motion: + const DrawerMotion(), + children: [ + SlidableAction( + borderRadius: + BorderRadius + .circular(20), + padding: + const EdgeInsets + .all(10), + spacing: 10, + onPressed: + ((context) => { + AwesomeDialog( + context: Get + .context!, + dialogType: DialogType + .question, + animType: AnimType + .bottomSlide, + dialogBackgroundColor: + primaryColor, + titleTextStyle: GoogleFonts + .poppins( + color: + secondaryColor, + fontSize: + 30, + fontWeight: + FontWeight.w500, + ), + descTextStyle: GoogleFonts + .poppins( + color: + secondaryColor, + fontSize: + 18, + fontWeight: + FontWeight.w400, + ), + title: + 'Konfirmasi', + bodyHeaderDistance: + 25, + desc: + 'Apakah yakin untuk menghapus item ini ?', + btnOkOnPress: + () { + controller.deleteFirstAgunan(controller.debiturController.insightDebitur.value.agunan!.firstWhere((element) => element.kodeAgunan == 6).id!, + 'agunan_los'); + }, + btnOkText: + 'Oke sip', + btnCancelText: + 'Affa iyh', + btnCancelOnPress: + () {}) + .show() + }), + backgroundColor: + GFColors.DANGER, + foregroundColor: + Colors.white, + icon: FontAwesomeIcons + .trash, + label: 'Hapus', + ), + ], + ), + child: Obx(() => controller .isAgunanInputProcessing .value ? const Center( child: - CircularProgressIndicator()) + CircularProgressIndicator(), + ) : FormBuilderCheckbox( - name: 'agunan_cash', + name: 'agunan_los', enabled: controller .debiturController .insightDebitur @@ -790,7 +929,7 @@ class AgunanPilihView extends GetView { ?.where((element) => element .kodeAgunan == - 5) + 6) .isEmpty == true ? true @@ -809,7 +948,7 @@ class AgunanPilihView extends GetView { .agunan ?.where((element) => element.kodeAgunan == - 5) + 6) .isEmpty == true ? GFColors.FOCUS @@ -817,7 +956,7 @@ class AgunanPilihView extends GetView { .SUCCESS, ), title: Text( - 'Cash Collateral', + 'Kios Pasar / Los', style: checkboxStyle, ), @@ -829,7 +968,7 @@ class AgunanPilihView extends GetView { ?.where((element) => element .kodeAgunan == - 5) + 6) .isEmpty == true ? false @@ -847,147 +986,114 @@ class AgunanPilihView extends GetView { .firstWhere( (element) => element.kodeAgunan == - 5, + 6, ), ) == true ? true : false, - ), + )), ), ), - ), - ], - ), - const SizedBox( - height: 12.0, - ), - Row( - children: [ - Expanded( - child: Slidable( - enabled: controller - .debiturController - .insightDebitur - .value - .agunan - ?.where((element) => - element - .kodeAgunan == - 6) - .isEmpty == - true - ? false - : true, - endActionPane: ActionPane( - motion: const DrawerMotion(), - children: [ - SlidableAction( - borderRadius: - BorderRadius.circular( - 20), - padding: - const EdgeInsets.all( - 10), - spacing: 10, - onPressed: ((context) => { - AwesomeDialog( - context: Get - .context!, - dialogType: DialogType - .question, - animType: AnimType - .bottomSlide, - dialogBackgroundColor: - primaryColor, - titleTextStyle: - GoogleFonts - .poppins( - color: - secondaryColor, - fontSize: - 30, - fontWeight: - FontWeight - .w500, - ), - descTextStyle: - GoogleFonts - .poppins( - color: - secondaryColor, - fontSize: - 18, - fontWeight: - FontWeight - .w400, - ), - title: - 'Konfirmasi', - bodyHeaderDistance: - 25, - desc: - 'Apakah yakin untuk menghapus item ini ?', - btnOkOnPress: - () { - controller.deleteFirstAgunan( - controller - .debiturController - .insightDebitur - .value - .agunan! - .firstWhere((element) => element.kodeAgunan == 6) - .id!, - 'agunan_los'); - }, - btnOkText: - 'Oke sip', - btnCancelText: - 'Affa iyh', - btnCancelOnPress: - () {}) - .show() - }), - backgroundColor: - GFColors.DANGER, - foregroundColor: - Colors.white, - icon: FontAwesomeIcons - .trash, - label: 'Hapus', - ), - ], - ), - child: Obx(() => controller - .isAgunanInputProcessing - .value - ? const Center( - child: - CircularProgressIndicator(), - ) - : FormBuilderCheckbox( - name: 'agunan_los', - enabled: controller - .debiturController - .insightDebitur - .value - .agunan - ?.where((element) => - element - .kodeAgunan == - 6) - .isEmpty == - true - ? true - : false, - activeColor: - primaryColor, - decoration: - InputDecoration( - border: - const OutlineInputBorder(), - filled: true, - fillColor: controller + const SizedBox( + width: 12.0, + ), + Expanded( + child: Slidable( + enabled: controller + .debiturController + .insightDebitur + .value + .agunan + ?.where((element) => + element + .kodeAgunan == + 7) + .isEmpty == + true + ? false + : true, + startActionPane: ActionPane( + motion: + const DrawerMotion(), + children: [ + SlidableAction( + borderRadius: + BorderRadius + .circular(20), + padding: + const EdgeInsets + .all(10), + spacing: 10, + onPressed: + ((context) => { + AwesomeDialog( + context: Get + .context!, + dialogType: DialogType + .question, + animType: AnimType + .bottomSlide, + dialogBackgroundColor: + primaryColor, + titleTextStyle: GoogleFonts + .poppins( + color: + secondaryColor, + fontSize: + 30, + fontWeight: + FontWeight.w500, + ), + descTextStyle: GoogleFonts + .poppins( + color: + secondaryColor, + fontSize: + 18, + fontWeight: + FontWeight.w400, + ), + title: + 'Konfirmasi', + bodyHeaderDistance: + 25, + desc: + 'Apakah yakin untuk menghapus item ini ?', + btnOkOnPress: + () { + controller.deleteFirstAgunan(controller.debiturController.insightDebitur.value.agunan!.firstWhere((element) => element.kodeAgunan == 7).id!, + 'agunan_lainnya'); + }, + btnOkText: + 'Oke sip', + btnCancelText: + 'Affa iyh', + btnCancelOnPress: + () {}) + .show() + }), + backgroundColor: + GFColors.DANGER, + foregroundColor: + Colors.white, + icon: FontAwesomeIcons + .trash, + label: 'Hapus', + ), + ], + ), + child: Obx(() => controller + .isAgunanInputProcessing + .value + ? const Center( + child: + CircularProgressIndicator(), + ) + : FormBuilderCheckbox( + name: + 'agunan_lainnya', + enabled: controller .debiturController .insightDebitur .value @@ -995,179 +1101,38 @@ class AgunanPilihView extends GetView { ?.where((element) => element .kodeAgunan == - 6) + 7) .isEmpty == true - ? GFColors.FOCUS - : GFColors - .SUCCESS, - ), - title: Text( - 'Kios Pasar / Los', - style: checkboxStyle, - ), - initialValue: controller - .debiturController - .insightDebitur - .value - .agunan - ?.where((element) => - element - .kodeAgunan == - 6) - .isEmpty == - true - ? false - : controller + ? true + : false, + activeColor: + primaryColor, + decoration: + InputDecoration( + border: + const OutlineInputBorder(), + filled: true, + fillColor: controller .debiturController .insightDebitur .value .agunan - ?.contains( - controller - .debiturController - .insightDebitur - .value - .agunan! - .firstWhere( - (element) => + ?.where((element) => element.kodeAgunan == - 6, - ), - ) == + 7) + .isEmpty == true - ? true - : false, - )), - ), - ), - const SizedBox( - width: 12.0, - ), - Expanded( - child: Slidable( - enabled: controller - .debiturController - .insightDebitur - .value - .agunan - ?.where((element) => - element - .kodeAgunan == - 7) - .isEmpty == - true - ? false - : true, - startActionPane: ActionPane( - motion: const DrawerMotion(), - children: [ - SlidableAction( - borderRadius: - BorderRadius.circular( - 20), - padding: - const EdgeInsets.all( - 10), - spacing: 10, - onPressed: ((context) => { - AwesomeDialog( - context: Get - .context!, - dialogType: DialogType - .question, - animType: AnimType - .bottomSlide, - dialogBackgroundColor: - primaryColor, - titleTextStyle: - GoogleFonts - .poppins( - color: - secondaryColor, - fontSize: - 30, - fontWeight: - FontWeight - .w500, - ), - descTextStyle: - GoogleFonts - .poppins( - color: - secondaryColor, - fontSize: - 18, - fontWeight: - FontWeight - .w400, - ), - title: - 'Konfirmasi', - bodyHeaderDistance: - 25, - desc: - 'Apakah yakin untuk menghapus item ini ?', - btnOkOnPress: - () { - controller.deleteFirstAgunan( - controller - .debiturController - .insightDebitur - .value - .agunan! - .firstWhere((element) => element.kodeAgunan == 7) - .id!, - 'agunan_lainnya'); - }, - btnOkText: - 'Oke sip', - btnCancelText: - 'Affa iyh', - btnCancelOnPress: - () {}) - .show() - }), - backgroundColor: - GFColors.DANGER, - foregroundColor: - Colors.white, - icon: FontAwesomeIcons - .trash, - label: 'Hapus', - ), - ], - ), - child: Obx(() => controller - .isAgunanInputProcessing - .value - ? const Center( - child: - CircularProgressIndicator(), - ) - : FormBuilderCheckbox( - name: 'agunan_lainnya', - enabled: controller - .debiturController - .insightDebitur - .value - .agunan - ?.where((element) => - element - .kodeAgunan == - 7) - .isEmpty == - true - ? true - : false, - activeColor: - primaryColor, - decoration: - InputDecoration( - border: - const OutlineInputBorder(), - filled: true, - fillColor: controller + ? GFColors.FOCUS + : GFColors + .SUCCESS, + ), + title: Text( + 'Lainnya', + style: + checkboxStyle, + ), + initialValue: controller .debiturController .insightDebitur .value @@ -1178,181 +1143,133 @@ class AgunanPilihView extends GetView { 7) .isEmpty == true - ? GFColors.FOCUS - : GFColors - .SUCCESS, - ), - title: Text( - 'Lainnya', - style: checkboxStyle, - ), - initialValue: controller - .debiturController - .insightDebitur - .value - .agunan - ?.where((element) => - element - .kodeAgunan == - 7) - .isEmpty == - true - ? false - : controller - .debiturController - .insightDebitur - .value - .agunan - ?.contains( - controller + ? false + : controller .debiturController .insightDebitur .value - .agunan! - .firstWhere( - (element) => - element.kodeAgunan == - 7, - ), - ) == - true - ? true - : false, - )), - ), - ), - ], - ), - const SizedBox( - height: 12.0, - ), - Row( - children: [ - Expanded( - child: Slidable( - enabled: controller - .debiturController - .insightDebitur - .value - .agunan - ?.where((element) => - element - .kodeAgunan == - 3) - .isEmpty == - true - ? false - : true, - endActionPane: ActionPane( - motion: const DrawerMotion(), - children: [ - SlidableAction( - borderRadius: - BorderRadius.circular( - 20), - padding: - const EdgeInsets.all( - 10), - spacing: 10, - onPressed: ((context) => { - AwesomeDialog( - context: Get - .context!, - dialogType: DialogType - .question, - animType: AnimType - .bottomSlide, - dialogBackgroundColor: - primaryColor, - titleTextStyle: - GoogleFonts - .poppins( - color: - secondaryColor, - fontSize: - 30, - fontWeight: - FontWeight - .w500, - ), - descTextStyle: - GoogleFonts - .poppins( - color: - secondaryColor, - fontSize: - 18, - fontWeight: - FontWeight - .w400, - ), - title: - 'Konfirmasi', - bodyHeaderDistance: - 25, - desc: - 'Apakah yakin untuk menghapus item ini ?', - btnOkOnPress: - () { - controller.deleteFirstAgunan( - controller - .debiturController - .insightDebitur - .value - .agunan! - .firstWhere((element) => element.kodeAgunan == 3) - .id!, - 'agunan_kendaraan'); - }, - btnOkText: - 'Oke sip', - btnCancelText: - 'Affa iyh', - btnCancelOnPress: - () {}) - .show() - }), - backgroundColor: - GFColors.DANGER, - foregroundColor: - Colors.white, - icon: FontAwesomeIcons - .trash, - label: 'Hapus', - ), - ], + .agunan + ?.contains( + controller + .debiturController + .insightDebitur + .value + .agunan! + .firstWhere( + (element) => + element.kodeAgunan == + 7, + ), + ) == + true + ? true + : false, + )), ), - child: Obx(() => controller - .isAgunanInputProcessing - .value - ? const Center( - child: - CircularProgressIndicator(), - ) - : FormBuilderCheckbox( - name: - 'agunan_kendaraan', - enabled: controller - .debiturController - .insightDebitur - .value - .agunan - ?.where((element) => - element - .kodeAgunan == - 3) - .isEmpty == - true - ? true - : false, - activeColor: - primaryColor, - decoration: - InputDecoration( - border: - const OutlineInputBorder(), - filled: true, - fillColor: controller + ), + ], + ), + const SizedBox( + height: 12.0, + ), + Row( + children: [ + Expanded( + child: Slidable( + enabled: controller + .debiturController + .insightDebitur + .value + .agunan + ?.where((element) => + element + .kodeAgunan == + 3) + .isEmpty == + true + ? false + : true, + endActionPane: ActionPane( + motion: + const DrawerMotion(), + children: [ + SlidableAction( + borderRadius: + BorderRadius + .circular(20), + padding: + const EdgeInsets + .all(10), + spacing: 10, + onPressed: + ((context) => { + AwesomeDialog( + context: Get + .context!, + dialogType: DialogType + .question, + animType: AnimType + .bottomSlide, + dialogBackgroundColor: + primaryColor, + titleTextStyle: GoogleFonts + .poppins( + color: + secondaryColor, + fontSize: + 30, + fontWeight: + FontWeight.w500, + ), + descTextStyle: GoogleFonts + .poppins( + color: + secondaryColor, + fontSize: + 18, + fontWeight: + FontWeight.w400, + ), + title: + 'Konfirmasi', + bodyHeaderDistance: + 25, + desc: + 'Apakah yakin untuk menghapus item ini ?', + btnOkOnPress: + () { + controller.deleteFirstAgunan(controller.debiturController.insightDebitur.value.agunan!.firstWhere((element) => element.kodeAgunan == 3).id!, + 'agunan_kendaraan'); + }, + btnOkText: + 'Oke sip', + btnCancelText: + 'Affa iyh', + btnCancelOnPress: + () {}) + .show() + }), + backgroundColor: + GFColors.DANGER, + foregroundColor: + Colors.white, + icon: FontAwesomeIcons + .trash, + label: 'Hapus', + ), + ], + ), + child: Obx(() => controller + .isAgunanInputProcessing + .value + ? const Center( + child: + CircularProgressIndicator(), + ) + : FormBuilderCheckbox( + name: + 'agunan_kendaraan', + enabled: controller .debiturController .insightDebitur .value @@ -1363,244 +1280,282 @@ class AgunanPilihView extends GetView { 3) .isEmpty == true - ? GFColors.FOCUS - : GFColors - .SUCCESS, - ), - title: Text( - 'Kendaraan', - style: checkboxStyle, - ), - initialValue: controller - .debiturController - .insightDebitur - .value - .agunan - ?.where((element) => - element - .kodeAgunan == - 3) - .isEmpty == - true - ? false - : controller + ? true + : false, + activeColor: + primaryColor, + decoration: + InputDecoration( + border: + const OutlineInputBorder(), + filled: true, + fillColor: controller .debiturController .insightDebitur .value .agunan - ?.contains( - controller + ?.where((element) => + element.kodeAgunan == + 3) + .isEmpty == + true + ? GFColors.FOCUS + : GFColors + .SUCCESS, + ), + title: Text( + 'Kendaraan', + style: + checkboxStyle, + ), + initialValue: controller + .debiturController + .insightDebitur + .value + .agunan + ?.where((element) => + element + .kodeAgunan == + 3) + .isEmpty == + true + ? false + : controller .debiturController .insightDebitur .value - .agunan! - .firstWhere( - (element) => - element.kodeAgunan == - 3, - ), - ) == - true - ? true - : false, - )), + .agunan + ?.contains( + controller + .debiturController + .insightDebitur + .value + .agunan! + .firstWhere( + (element) => + element.kodeAgunan == + 3, + ), + ) == + true + ? true + : false, + )), + ), ), - ), - const SizedBox( - width: 12.0, - ), - Expanded(child: Container()) - ], - ), - const SizedBox( - height: 30.0, - ), - const SizedBox( - height: 12.0, - ), - ], - ), - ), - ], - ) - : Column( - children: [ - Text( - 'Berikut adalah jenis agunan yang tersedia untuk plafond dibawah atau sama dengan Rp. 100.000.000', - style: Theme.of(context) - .textTheme - .bodySmall - ?.merge(const TextStyle(fontSize: 14)), - ), - const SizedBox( - height: 16.0, - ), - Slidable( - enabled: controller.debiturController - .insightDebitur.value.agunan - ?.where((element) => - element.kodeAgunan == 7) - .isEmpty == - true - ? false - : true, - startActionPane: ActionPane( - motion: const DrawerMotion(), - children: [ - SlidableAction( - borderRadius: BorderRadius.circular(20), - padding: const EdgeInsets.all(10), - spacing: 10, - onPressed: ((context) => { - AwesomeDialog( - context: Get.context!, - dialogType: - DialogType.question, - animType: - AnimType.bottomSlide, - dialogBackgroundColor: - primaryColor, - titleTextStyle: - GoogleFonts.poppins( - color: secondaryColor, - fontSize: 30, - fontWeight: FontWeight.w500, - ), - descTextStyle: - GoogleFonts.poppins( - color: secondaryColor, - fontSize: 18, - fontWeight: FontWeight.w400, - ), - title: 'Konfirmasi', - bodyHeaderDistance: 25, - desc: - 'Apakah yakin untuk menghapus item ini ?', - btnOkOnPress: () { - controller.deleteFirstAgunan( - controller - .debiturController - .insightDebitur - .value - .agunan! - .firstWhere((element) => - element - .kodeAgunan == - 7) - .id!, - 'agunan_lainnya'); - }, - btnOkText: 'Oke sip', - btnCancelText: 'Affa iyh', - btnCancelOnPress: () {}) - .show() - }), - backgroundColor: GFColors.DANGER, - foregroundColor: Colors.white, - icon: FontAwesomeIcons.trash, - label: 'Hapus', - ), - ], + const SizedBox( + width: 12.0, + ), + Expanded(child: Container()) + ], + ), + const SizedBox( + height: 30.0, + ), + const SizedBox( + height: 12.0, + ), + ], + ), + ), + ], + ) + : Column( + children: [ + Text( + 'Berikut adalah jenis agunan yang tersedia untuk plafond dibawah atau sama dengan Rp. 100.000.000', + style: Theme.of(context) + .textTheme + .bodySmall + ?.merge(const TextStyle(fontSize: 14)), ), - child: Obx(() => controller - .isAgunanInputProcessing.value - ? const Center( - child: CircularProgressIndicator(), - ) - : FormBuilderCheckbox( - name: 'agunan_lainnya', - enabled: controller.debiturController - .insightDebitur.value.agunan - ?.where((element) => - element.kodeAgunan == 7) - .isEmpty == - true - ? true - : false, - activeColor: primaryColor, - decoration: InputDecoration( - border: const OutlineInputBorder(), - filled: true, - fillColor: controller.debiturController + const SizedBox( + height: 16.0, + ), + Slidable( + enabled: controller.debiturController + .insightDebitur.value.agunan + ?.where((element) => + element.kodeAgunan == 7) + .isEmpty == + true + ? false + : true, + startActionPane: ActionPane( + motion: const DrawerMotion(), + children: [ + SlidableAction( + borderRadius: BorderRadius.circular(20), + padding: const EdgeInsets.all(10), + spacing: 10, + onPressed: ((context) => { + AwesomeDialog( + context: Get.context!, + dialogType: + DialogType.question, + animType: + AnimType.bottomSlide, + dialogBackgroundColor: + primaryColor, + titleTextStyle: + GoogleFonts.poppins( + color: secondaryColor, + fontSize: 30, + fontWeight: + FontWeight.w500, + ), + descTextStyle: + GoogleFonts.poppins( + color: secondaryColor, + fontSize: 18, + fontWeight: + FontWeight.w400, + ), + title: 'Konfirmasi', + bodyHeaderDistance: 25, + desc: + 'Apakah yakin untuk menghapus item ini ?', + btnOkOnPress: () { + controller.deleteFirstAgunan( + controller + .debiturController + .insightDebitur + .value + .agunan! + .firstWhere( + (element) => + element + .kodeAgunan == + 7) + .id!, + 'agunan_lainnya'); + }, + btnOkText: 'Oke sip', + btnCancelText: 'Affa iyh', + btnCancelOnPress: () {}) + .show() + }), + backgroundColor: GFColors.DANGER, + foregroundColor: Colors.white, + icon: FontAwesomeIcons.trash, + label: 'Hapus', + ), + ], + ), + child: Obx(() => controller + .isAgunanInputProcessing.value + ? const Center( + child: CircularProgressIndicator(), + ) + : FormBuilderCheckbox( + name: 'agunan_lainnya', + enabled: controller.debiturController .insightDebitur.value.agunan ?.where((element) => element.kodeAgunan == 7) .isEmpty == true - ? GFColors.FOCUS - : GFColors.SUCCESS, - ), - title: Text( - 'Lainnya', - style: checkboxStyle, - ), - initialValue: controller.debiturController - .insightDebitur.value.agunan - ?.where((element) => - element.kodeAgunan == 7) - .isEmpty == - true - ? false - : controller + ? true + : false, + activeColor: primaryColor, + decoration: InputDecoration( + border: const OutlineInputBorder(), + filled: true, + fillColor: controller .debiturController .insightDebitur .value .agunan - ?.contains( - controller + ?.where((element) => + element.kodeAgunan == + 7) + .isEmpty == + true + ? GFColors.FOCUS + : GFColors.SUCCESS, + ), + title: Text( + 'Lainnya', + style: checkboxStyle, + ), + initialValue: controller + .debiturController + .insightDebitur + .value + .agunan + ?.where((element) => + element.kodeAgunan == 7) + .isEmpty == + true + ? false + : controller .debiturController .insightDebitur .value - .agunan! - .firstWhere( - (element) => - element.kodeAgunan == - 7, - ), - ) == - true - ? true - : false, - )), - ) - ], - ), - ], - ), - - Obx(() => GFButton( - onPressed: () { - if (controller.formKey.currentState?.saveAndValidate() ?? - false) { - controller.saveMultipleAgunan(); - // controller.patchProgressBar(data.id); - // Get.back(); - debugPrint( - controller.formKey.currentState?.value.toString()); - } else { - debugPrint( - controller.formKey.currentState?.value.toString()); - debugPrint('validation failed'); - } - }, - color: primaryColor, - size: GFSize.LARGE, - fullWidthButton: true, - child: controller.isAgunanInputProcessing.value - ? const Center( - child: CircularProgressIndicator( - color: Colors.white, - ), - ) - : const Text( - 'Simpan', - style: TextStyle( - color: Colors.white, - fontSize: 18.0, - ), + .agunan + ?.contains( + controller + .debiturController + .insightDebitur + .value + .agunan! + .firstWhere( + (element) => + element + .kodeAgunan == + 7, + ), + ) == + true + ? true + : false, + )), + ) + ], ), - )), - ], + ], + ), + ], + ), + ), + ), + ), + bottomNavigationBar: Obx( + () => Container( + padding: const EdgeInsets.all(20.0), + height: 90.0, + child: ElevatedButton.icon( + icon: const Icon(Icons.favorite), + label: controller.isAgunanInputProcessing.value + ? const Center( + child: CircularProgressIndicator( + color: Colors.white, + ), + ) + : const Text( + 'Simpan', + style: TextStyle( + color: Colors.white, + fontSize: 18.0, + ), + ), + style: ElevatedButton.styleFrom( + backgroundColor: primaryColor, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(16), // <-- Radius + ), + ), + onPressed: () { + if (controller.formKey.currentState?.saveAndValidate() ?? false) { + controller.saveMultipleAgunan(); + // controller.patchProgressBar(data.id); + // Get.back(); + debugPrint(controller.formKey.currentState?.value.toString()); + } else { + debugPrint(controller.formKey.currentState?.value.toString()); + debugPrint('validation failed'); + } + }, ), ), ), diff --git a/lib/app/modules/detail_agunan/bindings/detail_agunan_binding.dart b/lib/app/modules/detail_agunan/bindings/detail_agunan_binding.dart new file mode 100644 index 00000000..7b0cb570 --- /dev/null +++ b/lib/app/modules/detail_agunan/bindings/detail_agunan_binding.dart @@ -0,0 +1,12 @@ +import 'package:get/get.dart'; + +import '../controllers/detail_agunan_controller.dart'; + +class DetailAgunanBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut( + () => DetailAgunanController(), + ); + } +} diff --git a/lib/app/modules/detail_agunan/controllers/detail_agunan_controller.dart b/lib/app/modules/detail_agunan/controllers/detail_agunan_controller.dart new file mode 100644 index 00000000..b0b6ab29 --- /dev/null +++ b/lib/app/modules/detail_agunan/controllers/detail_agunan_controller.dart @@ -0,0 +1,9 @@ +import 'package:akm/app/models/debitur_model/insight_debitur.model.dart'; +import 'package:flutter_map_marker_popup/flutter_map_marker_popup.dart'; +import 'package:get/get.dart'; + +class DetailAgunanController extends GetxController { + DebiturInsight args = Get.arguments; + + final PopupController popupLayerController = PopupController(); +} diff --git a/lib/app/modules/detail_agunan/views/detail_agunan_view.dart b/lib/app/modules/detail_agunan/views/detail_agunan_view.dart new file mode 100644 index 00000000..0ace7431 --- /dev/null +++ b/lib/app/modules/detail_agunan/views/detail_agunan_view.dart @@ -0,0 +1,2140 @@ +import 'package:akm/app/models/debitur_model/insight_debitur.model.dart'; +import 'package:akm/app/modules/list_agunan_tanah_bangunan/views/list_agunan_tanah_bangunan_view.dart'; +import 'package:extended_masked_text/extended_masked_text.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_map/flutter_map.dart'; +import 'package:flutter_map_marker_popup/flutter_map_marker_popup.dart'; + +import 'package:get/get.dart'; +import 'package:getwidget/getwidget.dart'; +import 'package:intl/intl.dart'; +import 'package:latlong2/latlong.dart'; + +import '../controllers/detail_agunan_controller.dart'; + +class DetailAgunanView extends GetView { + const DetailAgunanView({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + var agunanList = controller.args.agunan; + + Agunan agunanTanah = agunanList!.any((element) => element.kodeAgunan == 1) + ? agunanList.elementAt( + agunanList.indexWhere((element) => element.kodeAgunan == 1)) + : Agunan(); + + Agunan agunanTanahBangunan = + agunanList.any((element) => element.kodeAgunan == 2) + ? agunanList.elementAt( + agunanList.indexWhere((element) => element.kodeAgunan == 2)) + : Agunan(); + + Agunan agunanKendaraan = + agunanList.any((element) => element.kodeAgunan == 3) + ? agunanList.elementAt( + agunanList.indexWhere((element) => element.kodeAgunan == 3)) + : Agunan(); + + Agunan agunanPeralatan = + agunanList.any((element) => element.kodeAgunan == 4) + ? agunanList.elementAt( + agunanList.indexWhere((element) => element.kodeAgunan == 4)) + : Agunan(); + + Agunan agunanCash = agunanList.any((element) => element.kodeAgunan == 5) + ? agunanList.elementAt( + agunanList.indexWhere((element) => element.kodeAgunan == 5)) + : Agunan(); + + Agunan agunanLos = agunanList.any((element) => element.kodeAgunan == 6) + ? agunanList.elementAt( + agunanList.indexWhere((element) => element.kodeAgunan == 6)) + : Agunan(); + + Agunan agunanLainnya = agunanList.any((element) => element.kodeAgunan == 7) + ? agunanList.elementAt( + agunanList.indexWhere((element) => element.kodeAgunan == 7)) + : Agunan(); + + var formAgunanTanah = agunanTanah.formTanah; + var formAgunanTanahBangunan = agunanTanahBangunan.formTanahBangunan; + var formKendaraan = agunanKendaraan.formKendaraan; + var formPeralatan = agunanPeralatan.formPeralatan; + var formCash = agunanCash.formCash; + var formLos = agunanLos.formLos; + var formLainnya = agunanLainnya.formLainnya; + + return Scaffold( + appBar: AppBar( + title: Text('Agunan ${controller.args.peminjam1}'), + ), + body: Scrollbar( + child: SingleChildScrollView( + child: Container( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + formAgunanTanah != null + ? Column( + children: [ + Card( + color: Colors.blue[100], + child: ListTile( + leading: const CircleAvatar( + child: Icon(Icons.house), + ), + title: const Text("Agunan Tanah"), + subtitle: Text( + "Debitur ini memiliki ${formAgunanTanah.length} agunan tanah"), + ), + ), + const SizedBox( + height: 10.0, + ), + ListView.separated( + itemCount: + int.parse(formAgunanTanah.length.toString()), + separatorBuilder: (context, index) => + const SizedBox( + height: 12.0, + ), + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (context, index) { + return Card( + clipBehavior: Clip.antiAlias, + child: SizedBox( + width: MediaQuery.of(context).size.width, + child: Column( + children: [ + SizedBox( + width: + MediaQuery.of(context).size.width, + height: 300.0, + child: SizedBox( + height: 200, + width: 450, + child: FlutterMap( + options: MapOptions( + center: LatLng( + // Split string to get latitude and longitude + double.parse( + formAgunanTanah[index] + .titikKoordinat! + .split(',')[0]), + double.parse( + formAgunanTanah[index] + .titikKoordinat! + .split(',')[1]), + ), + zoom: 16, + interactiveFlags: + InteractiveFlag.all - + InteractiveFlag.rotate, + ), + children: [ + TileLayer( + urlTemplate: + 'https://mt1.google.com/vt/lyrs=m&x={x}&y={y}&z={z}', + userAgentPackageName: + 'dev.fleaflet.flutter_map.example', + ), + PopupMarkerLayerWidget( + options: + PopupMarkerLayerOptions( + popupController: controller + .popupLayerController, + markers: [ + Marker( + point: LatLng( + // Split string to get latitude and longitude + double.parse( + formAgunanTanah[ + index] + .titikKoordinat! + .split(',')[0]), + double.parse( + formAgunanTanah[ + index] + .titikKoordinat! + .split(',')[1]), + ), + width: 40, + height: 40, + builder: (_) => + const Icon( + Icons.location_on, + size: 50, + color: GFColors.DANGER, + ), + anchorPos: + AnchorPos.align( + AnchorAlign.top, + ), + ), + ], + markerRotateAlignment: + PopupMarkerLayerOptions + .rotationAlignmentFor( + AnchorAlign.top), + popupBuilder: + (BuildContext context, + Marker marker) => + ExamplePopup(marker), + ), + ) + ], + ), + ), + ), + Container( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + children: [ + Text( + "Agunan Tanah ${index + 1}", + style: const TextStyle( + fontSize: 12.0, + ), + ), + const Spacer(), + Text( + "Tgl Input: ${DateFormat('dd/MM/yy').format(DateTime.parse(formAgunanTanah[index].tanggal.toString()))}", + style: const TextStyle( + fontSize: 10.0, + ), + ), + ], + ), + const SizedBox( + height: 10.0, + ), + Text( + "${formAgunanTanah[index].deskripsiPendek}", + style: const TextStyle( + fontSize: 12.0, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox( + height: 6.0, + ), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Table( + columnWidths: const { + 0: FlexColumnWidth(0.5), + 1: FlexColumnWidth(0.1), + 2: FlexColumnWidth(1), + }, + children: [ + TableRow( + children: [ + paddedTextTanah( + 'Atas Nama'), + paddedTextTanah(':'), + paddedTextTanah( + formAgunanTanah[index] + .namaPemilik + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Bukti Kepemilikan'), + paddedTextTanah(':'), + paddedTextTanah( + formAgunanTanah[index] + .buktiKepemilikan + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah('Luas'), + paddedTextTanah(':'), + paddedTextTanah( + '${formAgunanTanah[index].luasTanah} m2', + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Nilai Pasar'), + paddedTextTanah(':'), + paddedTextTanah( + 'Rp. ${MoneyMaskedTextController(thousandSeparator: '.', decimalSeparator: '', precision: 0, initialValue: double.parse(formAgunanTanah[index].nilaiPasar.toString())).text}'), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Nilai Liquidasi'), + paddedTextTanah(':'), + paddedTextTanah( + 'Rp. ${MoneyMaskedTextController(thousandSeparator: '.', decimalSeparator: '', precision: 0, initialValue: double.parse(formAgunanTanah[index].nilaiLiquidasi.toString())).text}', + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Lokasi'), + paddedTextTanah(':'), + paddedTextTanah( + formAgunanTanah[index] + .lokasi + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Pengikatan'), + paddedTextTanah(':'), + paddedTextTanah( + formAgunanTanah[index] + .pengikatan + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah(''), + const SizedBox.shrink(), + const SizedBox.shrink(), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Pemilik'), + paddedTextTanah(':'), + paddedTextTanah( + formAgunanTanah[index] + .namaPemilik + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Alamat'), + paddedTextTanah(':'), + paddedTextTanah( + formAgunanTanah[index] + .lokasi + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Titik Koordinat'), + paddedTextTanah(':'), + paddedTextTanah( + formAgunanTanah[index] + .titikKoordinat + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah(''), + const SizedBox.shrink(), + const SizedBox.shrink(), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Summary'), + paddedTextTanah(':'), + paddedTextTanah( + formAgunanTanah[index] + .deskripsiPanjang + .toString(), + ), + ], + ), + ], + ), + ], + ) + ], + ), + ), + ], + ), + ), + ); + }, + ), + ], + ) + : const SizedBox.shrink(), + formAgunanTanah != null + ? const SizedBox( + height: 10.0, + ) + : const SizedBox.shrink(), + formAgunanTanahBangunan != null + ? Column( + children: [ + Card( + color: Colors.amber[100], + child: ListTile( + leading: const CircleAvatar( + child: Icon(Icons.houseboat_rounded), + ), + title: const Text("Agunan Tanah dan Bangunan"), + subtitle: Text( + "Debitur ini memiliki ${formAgunanTanahBangunan.length} agunan tanah dan bangunan"), + ), + ), + const SizedBox( + height: 10.0, + ), + ListView.separated( + itemCount: int.parse( + formAgunanTanahBangunan.length.toString()), + separatorBuilder: (context, index) => + const SizedBox( + height: 12.0, + ), + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (context, index) { + return Card( + clipBehavior: Clip.antiAlias, + child: SizedBox( + width: MediaQuery.of(context).size.width, + child: Column( + children: [ + SizedBox( + width: + MediaQuery.of(context).size.width, + height: 300.0, + child: SizedBox( + height: 200, + width: 450, + child: FlutterMap( + options: MapOptions( + center: LatLng( + // Split string to get latitude and longitude + double.parse( + formAgunanTanahBangunan[ + index] + .titikKoordinat! + .split(',')[0]), + double.parse( + formAgunanTanahBangunan[ + index] + .titikKoordinat! + .split(',')[1]), + ), + zoom: 16, + interactiveFlags: + InteractiveFlag.all - + InteractiveFlag.rotate, + ), + children: [ + TileLayer( + urlTemplate: + 'https://mt1.google.com/vt/lyrs=m&x={x}&y={y}&z={z}', + userAgentPackageName: + 'dev.fleaflet.flutter_map.example', + ), + PopupMarkerLayerWidget( + options: + PopupMarkerLayerOptions( + popupController: controller + .popupLayerController, + markers: [ + Marker( + point: LatLng( + // Split string to get latitude and longitude + double.parse( + formAgunanTanahBangunan[ + index] + .titikKoordinat! + .split(',')[0]), + double.parse( + formAgunanTanahBangunan[ + index] + .titikKoordinat! + .split(',')[1]), + ), + width: 40, + height: 40, + builder: (_) => + const Icon( + Icons.location_on, + size: 50, + color: GFColors.DANGER, + ), + anchorPos: + AnchorPos.align( + AnchorAlign.top, + ), + ), + ], + markerRotateAlignment: + PopupMarkerLayerOptions + .rotationAlignmentFor( + AnchorAlign.top), + popupBuilder: + (BuildContext context, + Marker marker) => + ExamplePopup(marker), + ), + ) + ], + ), + ), + ), + Container( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + children: [ + Text( + "Agunan Tanah Bangunan ${index + 1}", + style: const TextStyle( + fontSize: 12.0, + ), + ), + const Spacer(), + Text( + "Tgl Input: ${DateFormat('dd/MM/yy').format(DateTime.parse(formAgunanTanahBangunan[index].tanggal.toString()))}", + style: const TextStyle( + fontSize: 10.0, + ), + ), + ], + ), + const SizedBox( + height: 10.0, + ), + Text( + "${formAgunanTanah![index].deskripsiPendek}", + style: const TextStyle( + fontSize: 12.0, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox( + height: 6.0, + ), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Table( + columnWidths: const { + 0: FlexColumnWidth(0.5), + 1: FlexColumnWidth(0.1), + 2: FlexColumnWidth(1), + }, + children: [ + TableRow( + children: [ + paddedTextTanah( + 'Atas Nama'), + paddedTextTanah(':'), + paddedTextTanah( + formAgunanTanahBangunan[ + index] + .namaPemilik + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Bukti Kepemilikan'), + paddedTextTanah(':'), + paddedTextTanah( + formAgunanTanahBangunan[ + index] + .buktiKepemilikan + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah('Luas'), + paddedTextTanah(':'), + paddedTextTanah( + '${formAgunanTanahBangunan[index].luasTanah} m2', + ), + ], + ), + TableRow( + children: [ + paddedTextTanah(''), + const SizedBox.shrink(), + const SizedBox.shrink(), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Nilai Pasar Tanah'), + paddedTextTanah(':'), + paddedTextTanah( + 'Rp. ${MoneyMaskedTextController(thousandSeparator: '.', decimalSeparator: '', precision: 0, initialValue: double.parse(formAgunanTanahBangunan[index].nilaiPasarTanah.toString())).text}'), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Nilai Liquidasi Tanah'), + paddedTextTanah(':'), + paddedTextTanah( + 'Rp. ${MoneyMaskedTextController(thousandSeparator: '.', decimalSeparator: '', precision: 0, initialValue: double.parse(formAgunanTanahBangunan[index].nilaiLiquidasiTanah.toString())).text}'), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Nilai Pasar Bangunan'), + paddedTextTanah(':'), + paddedTextTanah( + 'Rp. ${MoneyMaskedTextController(thousandSeparator: '.', decimalSeparator: '', precision: 0, initialValue: double.parse(formAgunanTanahBangunan[index].nilaiPasarBangunan.toString())).text}'), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Nilai Liquidasi Bangunan'), + paddedTextTanah(':'), + paddedTextTanah( + 'Rp. ${MoneyMaskedTextController(thousandSeparator: '.', decimalSeparator: '', precision: 0, initialValue: double.parse(formAgunanTanahBangunan[index].nilaiLiquidasiBangunan.toString())).text}'), + ], + ), + TableRow( + children: [ + paddedTextTanah(''), + const SizedBox.shrink(), + const SizedBox.shrink(), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Total Nilai Pasar'), + paddedTextTanah(':'), + paddedTextTanah( + 'Rp. ${MoneyMaskedTextController(thousandSeparator: '.', decimalSeparator: '', precision: 0, initialValue: double.parse(formAgunanTanahBangunan[index].nilaiPasar.toString())).text}'), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Total Nilai Liquidasi'), + paddedTextTanah(':'), + paddedTextTanah( + 'Rp. ${MoneyMaskedTextController(thousandSeparator: '.', decimalSeparator: '', precision: 0, initialValue: double.parse(formAgunanTanahBangunan[index].nilaiLiquidasi.toString())).text}', + ), + ], + ), + TableRow( + children: [ + paddedTextTanah(''), + const SizedBox.shrink(), + const SizedBox.shrink(), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Lokasi'), + paddedTextTanah(':'), + paddedTextTanah( + formAgunanTanahBangunan[ + index] + .lokasi + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Pengikatan'), + paddedTextTanah(':'), + paddedTextTanah( + formAgunanTanahBangunan[ + index] + .pengikatan + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah(''), + const SizedBox.shrink(), + const SizedBox.shrink(), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Pemilik'), + paddedTextTanah(':'), + paddedTextTanah( + formAgunanTanahBangunan[ + index] + .namaPemilik + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Alamat'), + paddedTextTanah(':'), + paddedTextTanah( + formAgunanTanahBangunan[ + index] + .lokasi + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Titik Koordinat'), + paddedTextTanah(':'), + paddedTextTanah( + formAgunanTanahBangunan[ + index] + .titikKoordinat + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah(''), + const SizedBox.shrink(), + const SizedBox.shrink(), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Summary'), + paddedTextTanah(':'), + paddedTextTanah( + formAgunanTanahBangunan[ + index] + .deskripsiPanjang + .toString(), + ), + ], + ), + ], + ), + ], + ) + ], + ), + ), + ], + ), + ), + ); + }, + ), + ], + ) + : const SizedBox.shrink(), + formAgunanTanahBangunan != null + ? const SizedBox( + height: 10.0, + ) + : const SizedBox.shrink(), + formKendaraan != null + ? Column( + children: [ + Card( + color: Colors.pink[100], + child: ListTile( + leading: const CircleAvatar( + child: Icon(Icons.motorcycle), + ), + title: const Text("Agunan Kendaraan"), + subtitle: Text( + "Debitur ini memiliki ${formKendaraan.length} agunan kendaraan"), + ), + ), + const SizedBox( + height: 10.0, + ), + ListView.separated( + itemCount: + int.parse(formKendaraan.length.toString()), + separatorBuilder: (context, index) => + const SizedBox( + height: 12.0, + ), + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (context, index) { + return Card( + clipBehavior: Clip.antiAlias, + child: SizedBox( + width: MediaQuery.of(context).size.width, + child: Column( + children: [ + Container( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + children: [ + Text( + "Agunan Kendaraan ${index + 1}", + style: const TextStyle( + fontSize: 12.0, + ), + ), + const Spacer(), + ], + ), + const SizedBox( + height: 10.0, + ), + Text( + formKendaraan[index] + .jenis + .toString() == + 'Spd Motor' + ? "Kendaraan Roda 2" + : "Kendaraan Roda 4", + style: const TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + ), + ), + const SizedBox( + height: 6.0, + ), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Table( + columnWidths: const { + 0: FlexColumnWidth(0.5), + 1: FlexColumnWidth(0.1), + 2: FlexColumnWidth(1), + }, + children: [ + TableRow( + children: [ + paddedTextTanah( + 'Jenis'), + paddedTextTanah(':'), + paddedTextTanah( + formKendaraan[index] + .jenis + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah('Merk'), + paddedTextTanah(':'), + paddedTextTanah( + formKendaraan[index] + .merk + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah('Tipe'), + paddedTextTanah(':'), + paddedTextTanah( + formKendaraan[index] + .type + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Warna'), + paddedTextTanah(':'), + paddedTextTanah( + formKendaraan[index] + .warna + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Tahun'), + paddedTextTanah(':'), + paddedTextTanah( + formKendaraan[index] + .tahun + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'No. Polisi'), + paddedTextTanah(':'), + paddedTextTanah( + formKendaraan[index] + .noPolisi + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'No. Rangka'), + paddedTextTanah(':'), + paddedTextTanah( + formKendaraan[index] + .noRangka + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'No. Mesin'), + paddedTextTanah(':'), + paddedTextTanah( + formKendaraan[index] + .noMesin + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'No. BPKB'), + paddedTextTanah(':'), + paddedTextTanah( + formKendaraan[index] + .noBpkb + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Atas Nama'), + paddedTextTanah(':'), + paddedTextTanah( + formKendaraan[index] + .namaPemilik + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Keadaan'), + paddedTextTanah(':'), + paddedTextTanah( + formKendaraan[index] + .kondisi + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah(''), + paddedTextTanah(''), + paddedTextTanah(''), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Nilai Pasar'), + paddedTextTanah(':'), + paddedTextTanah( + 'Rp. ${MoneyMaskedTextController( + decimalSeparator: + '', + thousandSeparator: + '.', + precision: 0, + initialValue: + double.parse( + formKendaraan[ + index] + .nilaiPasar + .toString(), + ), + ).text}', + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Nilai Likuidasi'), + paddedTextTanah(':'), + paddedTextTanah( + 'Rp. ${MoneyMaskedTextController( + decimalSeparator: + '', + thousandSeparator: + '.', + precision: 0, + initialValue: + double.parse( + formKendaraan[ + index] + .nilaiLiquidasi + .toString(), + ), + ).text}', + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Nilai Pengikatan'), + paddedTextTanah(':'), + paddedTextTanah( + 'Rp. ${MoneyMaskedTextController( + decimalSeparator: + '', + thousandSeparator: + '.', + precision: 0, + initialValue: + double.parse( + formKendaraan[ + index] + .nilaiPengikatan + .toString(), + ), + ).text}', + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Pengikatan'), + paddedTextTanah(':'), + paddedTextTanah( + formKendaraan[index] + .pengikatan + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah(''), + paddedTextTanah(''), + paddedTextTanah(''), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Pemilik'), + paddedTextTanah(':'), + paddedTextTanah( + formKendaraan[index] + .namaPemilik + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah(''), + paddedTextTanah(''), + paddedTextTanah(''), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Summary'), + paddedTextTanah(':'), + paddedTextTanah( + '${formKendaraan[index].jenis == 'Spd Motor' ? 'Kendaraan Roda 2 (Dua)' : 'Kendaraan Roda 4 (Empat)'} Merk ${formKendaraan[index].merk} Tahun ${formKendaraan[index].tahun}, sesuai yang tercantum dalam BPKB asli ${formKendaraan[index].noBpkb}, No Polisi ${formKendaraan[index].noPolisi}, No Rangka ${formKendaraan[index].noRangka}, No Mesin ${formKendaraan[index].noMesin}, Warna ${formKendaraan[index].warna}, dengan kondisi ${formKendaraan[index].kondisi}'), + ], + ), + ], + ), + ], + ) + ], + ), + ), + ], + ), + ), + ); + }, + ), + ], + ) + : const SizedBox.shrink(), + formKendaraan != null + ? const SizedBox( + height: 10.0, + ) + : const SizedBox.shrink(), + formPeralatan != null + ? Column( + children: [ + Card( + color: Colors.purple[100], + child: ListTile( + leading: const CircleAvatar( + child: Icon(Icons.settings), + ), + title: const Text("Agunan Peralatan"), + subtitle: Text( + "Debitur ini memiliki ${formPeralatan.length} agunan peralatan"), + ), + ), + const SizedBox( + height: 10.0, + ), + ListView.separated( + itemCount: + int.parse(formPeralatan.length.toString()), + separatorBuilder: (context, index) => + const SizedBox( + height: 12.0, + ), + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (context, index) { + return Card( + clipBehavior: Clip.antiAlias, + child: SizedBox( + width: MediaQuery.of(context).size.width, + child: Column( + children: [ + Container( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + children: [ + Text( + "Agunan Peralatan ${index + 1}", + style: const TextStyle( + fontSize: 12.0, + ), + ), + const Spacer(), + ], + ), + const SizedBox( + height: 10.0, + ), + Text( + "${formPeralatan[index].deskripsiPanjang}", + style: const TextStyle( + fontSize: 12.0, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox( + height: 6.0, + ), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Table( + columnWidths: const { + 0: FlexColumnWidth(0.5), + 1: FlexColumnWidth(0.1), + 2: FlexColumnWidth(1), + }, + children: [ + TableRow( + children: [ + paddedTextTanah(''), + paddedTextTanah(':'), + paddedTextTanah(''), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Nilai Pasar'), + paddedTextTanah(':'), + paddedTextTanah( + 'Rp. ${MoneyMaskedTextController( + decimalSeparator: + '', + thousandSeparator: + '.', + precision: 0, + initialValue: + double.parse( + formPeralatan[ + index] + .nilaiPasar + .toString(), + ), + ).text}', + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Nilai Liquidasi'), + paddedTextTanah(':'), + paddedTextTanah( + 'Rp. ${MoneyMaskedTextController( + decimalSeparator: + '', + thousandSeparator: + '.', + precision: 0, + initialValue: + double.parse( + formPeralatan[ + index] + .nilaiLiquidasi + .toString(), + ), + ).text}', + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Nilai Pengikatan'), + paddedTextTanah(':'), + paddedTextTanah( + 'Rp. ${MoneyMaskedTextController( + decimalSeparator: + '', + thousandSeparator: + '.', + precision: 0, + initialValue: + double.parse( + formPeralatan[ + index] + .nilaiPengikatan + .toString(), + ), + ).text}', + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Pengikatan'), + paddedTextTanah(':'), + paddedTextTanah( + formPeralatan[index] + .pengikatan + .toString(), + ), + ], + ), + ], + ), + ], + ) + ], + ), + ), + ], + ), + ), + ); + }, + ), + ], + ) + : const SizedBox.shrink(), + formPeralatan != null + ? const SizedBox( + height: 10.0, + ) + : const SizedBox.shrink(), + formCash != null + ? Column( + children: [ + Card( + color: Colors.red[100], + child: ListTile( + leading: const CircleAvatar( + child: Icon(Icons.attach_money), + ), + title: const Text("Agunan Cash"), + subtitle: Text( + "Debitur ini memiliki ${formCash.length} agunan cash"), + ), + ), + const SizedBox( + height: 10.0, + ), + ListView.separated( + itemCount: int.parse(formCash.length.toString()), + separatorBuilder: (context, index) => + const SizedBox( + height: 12.0, + ), + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (context, index) { + return Card( + clipBehavior: Clip.antiAlias, + child: SizedBox( + width: MediaQuery.of(context).size.width, + child: Column( + children: [ + Container( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + children: [ + Text( + "Agunan Cash ${index + 1}", + style: const TextStyle( + fontSize: 12.0, + ), + ), + const Spacer(), + ], + ), + const SizedBox( + height: 10.0, + ), + Text( + "${formPeralatan![index].deskripsiPanjang}", + style: const TextStyle( + fontSize: 12.0, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox( + height: 6.0, + ), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Table( + columnWidths: const { + 0: FlexColumnWidth(0.5), + 1: FlexColumnWidth(0.1), + 2: FlexColumnWidth(1), + }, + children: [ + TableRow( + children: [ + paddedTextTanah(''), + paddedTextTanah(':'), + paddedTextTanah(''), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Nilai Pasar'), + paddedTextTanah(':'), + paddedTextTanah( + 'Rp. ${MoneyMaskedTextController( + decimalSeparator: + '', + thousandSeparator: + '.', + precision: 0, + initialValue: + double.parse( + formCash[index] + .nilaiPasar + .toString(), + ), + ).text}', + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Nilai Liquidasi'), + paddedTextTanah(':'), + paddedTextTanah( + 'Rp. ${MoneyMaskedTextController( + decimalSeparator: + '', + thousandSeparator: + '.', + precision: 0, + initialValue: + double.parse( + formCash[index] + .nilaiLiquidasi + .toString(), + ), + ).text}', + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Nilai Pengikatan'), + paddedTextTanah(':'), + paddedTextTanah( + 'Rp. ${MoneyMaskedTextController( + decimalSeparator: + '', + thousandSeparator: + '.', + precision: 0, + initialValue: + double.parse( + formCash[index] + .nilaiPengikatan + .toString(), + ), + ).text}', + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Pengikatan'), + paddedTextTanah(':'), + paddedTextTanah( + formCash[index] + .pengikatan + .toString(), + ), + ], + ), + ], + ), + ], + ) + ], + ), + ), + ], + ), + ), + ); + }, + ), + ], + ) + : const SizedBox.shrink(), + formCash != null + ? const SizedBox( + height: 10.0, + ) + : const SizedBox.shrink(), + const SizedBox( + height: 10.0, + ), + formLos != null + ? Column( + children: [ + Card( + color: Colors.green[100], + child: ListTile( + leading: const CircleAvatar( + child: Icon(Icons.shopify_rounded), + ), + title: const Text("Agunan Los / Kios Pasar"), + subtitle: Text( + "Debitur ini memiliki ${formLos.length} agunan los"), + ), + ), + const SizedBox( + height: 10.0, + ), + ListView.separated( + itemCount: int.parse(formLos.length.toString()), + separatorBuilder: (context, index) => + const SizedBox( + height: 12.0, + ), + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (context, index) { + return Card( + clipBehavior: Clip.antiAlias, + child: SizedBox( + width: MediaQuery.of(context).size.width, + child: Column( + children: [ + SizedBox( + width: + MediaQuery.of(context).size.width, + height: 300.0, + child: SizedBox( + height: 200, + width: 450, + child: FlutterMap( + options: MapOptions( + center: LatLng( + // Split string to get latitude and longitude + double.parse(formLos[index] + .titikKoordinat! + .split(',')[0]), + double.parse(formLos[index] + .titikKoordinat! + .split(',')[1]), + ), + zoom: 16, + interactiveFlags: + InteractiveFlag.all - + InteractiveFlag.rotate, + ), + children: [ + TileLayer( + urlTemplate: + 'https://mt1.google.com/vt/lyrs=m&x={x}&y={y}&z={z}', + userAgentPackageName: + 'dev.fleaflet.flutter_map.example', + ), + PopupMarkerLayerWidget( + options: + PopupMarkerLayerOptions( + popupController: controller + .popupLayerController, + markers: [ + Marker( + point: LatLng( + // Split string to get latitude and longitude + double.parse( + formLos[index] + .titikKoordinat! + .split(',')[0]), + double.parse( + formLos[index] + .titikKoordinat! + .split(',')[1]), + ), + width: 40, + height: 40, + builder: (_) => + const Icon( + Icons.location_on, + size: 50, + color: GFColors.DANGER, + ), + anchorPos: + AnchorPos.align( + AnchorAlign.top, + ), + ), + ], + markerRotateAlignment: + PopupMarkerLayerOptions + .rotationAlignmentFor( + AnchorAlign.top), + popupBuilder: + (BuildContext context, + Marker marker) => + ExamplePopup(marker), + ), + ) + ], + ), + ), + ), + Container( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + children: [ + Text( + "Agunan Los ${index + 1}", + style: const TextStyle( + fontSize: 12.0, + ), + ), + const Spacer(), + ], + ), + const SizedBox( + height: 10.0, + ), + Text( + "${formLos[index].deskripsiPendek}", + style: const TextStyle( + fontSize: 12.0, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox( + height: 6.0, + ), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Table( + columnWidths: const { + 0: FlexColumnWidth(0.5), + 1: FlexColumnWidth(0.1), + 2: FlexColumnWidth(1), + }, + children: [ + TableRow( + children: [ + paddedTextTanah( + 'Atas Nama'), + paddedTextTanah(':'), + paddedTextTanah( + formLos[index] + .namaPemilik + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Tempat Tgl Lahir'), + paddedTextTanah(':'), + paddedTextTanah( + '${formLos[index].tempatLahir.toString()}, ${DateFormat('dd MMMM yyyy').format(DateTime.parse(formLos[index].tanggalLahir.toString()))}', + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Alamat'), + paddedTextTanah(':'), + paddedTextTanah( + formLos[index] + .alamatPemilik + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Komponen'), + paddedTextTanah(':'), + paddedTextTanah( + formLos[index] + .komponen + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Tempat Dasaran'), + paddedTextTanah(':'), + paddedTextTanah( + formLos[index] + .tempatDasaran + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'No Registrasi'), + paddedTextTanah(':'), + paddedTextTanah( + formLos[index] + .noRegistrasi + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah('Luas'), + paddedTextTanah(':'), + paddedTextTanah( + '${formLos[index].luasLos.toString()} m2', + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Jenis Dagangan'), + paddedTextTanah(':'), + paddedTextTanah( + formLos[index] + .jenisDagangan + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Jam Buka'), + paddedTextTanah(':'), + paddedTextTanah( + '${formLos[index].waktuBuka.toString()} - ${formLos[index].waktuTutup.toString()} WIB', + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Berlaku s/d'), + paddedTextTanah(':'), + paddedTextTanah( + DateFormat( + 'dd MMMM yyyy') + .format(DateTime + .parse(formLos[ + index] + .berlakuSampai + .toString())), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah(''), + paddedTextTanah(''), + paddedTextTanah(''), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Nilai Pasar'), + paddedTextTanah(':'), + paddedTextTanah( + 'Rp. ${MoneyMaskedTextController( + decimalSeparator: + '', + thousandSeparator: + '.', + precision: 0, + initialValue: + double.parse( + formLos[index] + .nilaiPasar + .toString(), + ), + ).text}', + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Nilai Likuidasi'), + paddedTextTanah(':'), + paddedTextTanah( + 'Rp. ${MoneyMaskedTextController( + decimalSeparator: + '', + thousandSeparator: + '.', + precision: 0, + initialValue: + double.parse( + formLos[index] + .nilaiLiquidasi + .toString(), + ), + ).text}', + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Nilai Pengikatan'), + paddedTextTanah(':'), + paddedTextTanah( + 'Rp. ${MoneyMaskedTextController( + decimalSeparator: + '', + thousandSeparator: + '.', + precision: 0, + initialValue: + double.parse( + formLos[index] + .nilaiPengikatan + .toString(), + ), + ).text}', + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Pengikatan'), + paddedTextTanah(':'), + paddedTextTanah( + formLos[index] + .pengikatan + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah(''), + paddedTextTanah(''), + paddedTextTanah(''), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Lokasi Pasar'), + paddedTextTanah(':'), + paddedTextTanah( + formLos[index] + .lokasiPasar + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Titik Koordinat'), + paddedTextTanah(':'), + paddedTextTanah( + formLos[index] + .titikKoordinat + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah(''), + paddedTextTanah(''), + paddedTextTanah(''), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Pemilik'), + paddedTextTanah(':'), + paddedTextTanah( + formLos[index] + .namaPemilik + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Alamat'), + paddedTextTanah(':'), + paddedTextTanah( + formLos[index] + .alamatPemilik + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Summary'), + paddedTextTanah(':'), + paddedTextTanah( + formLos[index] + .deskripsiPanjang + .toString(), + ), + ], + ), + ], + ), + ], + ) + ], + ), + ), + ], + ), + ), + ); + }, + ), + ], + ) + : const SizedBox.shrink(), + formLos != null + ? const SizedBox( + height: 10.0, + ) + : const SizedBox.shrink(), + formLainnya != null + ? Column( + children: [ + Card( + color: Colors.lime[100], + child: ListTile( + leading: const CircleAvatar( + child: Icon(Icons.food_bank), + ), + title: const Text("Agunan Lainnya"), + subtitle: Text( + "Debitur ini memiliki ${formLainnya.length} agunan lainnya"), + ), + ), + const SizedBox( + height: 10.0, + ), + ListView.separated( + itemCount: int.parse(formLainnya.length.toString()), + separatorBuilder: (context, index) => + const SizedBox( + height: 12.0, + ), + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (context, index) { + return Card( + clipBehavior: Clip.antiAlias, + child: SizedBox( + width: MediaQuery.of(context).size.width, + child: Column( + children: [ + Container( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + "${formLainnya[index].deskripsiPanjang}", + style: const TextStyle( + fontSize: 12.0, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox( + height: 6.0, + ), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Table( + columnWidths: const { + 0: FlexColumnWidth(0.5), + 1: FlexColumnWidth(0.1), + 2: FlexColumnWidth(1), + }, + children: [ + TableRow( + children: [ + paddedTextTanah( + 'Keterangan'), + paddedTextTanah(':'), + paddedTextTanah( + formLainnya[index] + .deskripsiPanjang + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Perusahaan'), + paddedTextTanah(':'), + paddedTextTanah( + formLainnya[index] + .namaAsuransiPenjamin + .toString(), + ), + ], + ), + TableRow( + children: [ + paddedTextTanah(''), + paddedTextTanah(':'), + paddedTextTanah(''), + ], + ), + TableRow( + children: [ + paddedTextTanah( + 'Nilai Pasar'), + paddedTextTanah(':'), + paddedTextTanah( + 'Rp. ${MoneyMaskedTextController( + decimalSeparator: + '', + thousandSeparator: + '.', + precision: 0, + initialValue: + double.parse( + formLainnya[index] + .nilaiPasar + .toString(), + ), + ).text}', + ), + ], + ), + // TableRow( + // children: [ + // paddedTextTanah('Nilai Liquidasi'), + // paddedTextTanah(':'), + // paddedTextTanah( + // 'Rp. ${MoneyMaskedTextController( + // decimalSeparator: '', + // thousandSeparator: '.', + // precision: 0, + // initialValue: double.parse( + // controller.listAgunanLainnya[index] + // .nilaiLiquidasi + // .toString(), + // ), + // ).text}', + // ), + // ], + // ), + // TableRow( + // children: [ + // paddedTextTanah('Nilai Pengikatan'), + // paddedTextTanah(':'), + // paddedTextTanah( + // 'Rp. ${MoneyMaskedTextController( + // decimalSeparator: '', + // thousandSeparator: '.', + // precision: 0, + // initialValue: double.parse( + // controller.listAgunanLainnya[index] + // .nilaiPengikatan + // .toString(), + // ), + // ).text}', + // ), + // ], + // ), + // TableRow( + // children: [ + // paddedTextTanah('Pengikatan'), + // paddedTextTanah(':'), + // paddedTextTanah( + // controller + // .listAgunanLainnya[index].pengikatan + // .toString(), + // ), + // ], + // ), + ], + ), + ], + ) + ], + ), + ), + ], + ), + ), + ); + }, + ), + ], + ) + : const SizedBox.shrink() + ], + ), + ), + ), + ), + ); + } +} + +Widget paddedTextTanah(String text) { + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 1.0, vertical: 2.0), + child: Text( + text, + style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w400), + ), + ); +} diff --git a/lib/app/modules/reviewer_submit/controllers/reviewer_submit_controller.dart b/lib/app/modules/reviewer_submit/controllers/reviewer_submit_controller.dart index 6f160e0c..ffefc0ea 100644 --- a/lib/app/modules/reviewer_submit/controllers/reviewer_submit_controller.dart +++ b/lib/app/modules/reviewer_submit/controllers/reviewer_submit_controller.dart @@ -33,15 +33,6 @@ class ReviewerSubmitController extends GetxController { super.onInit(); } - @override - void onReady() { - Future.delayed(const Duration(seconds: 5), () { - getRating(); - }); - - super.onReady(); - } - var bahasanReviewer = List.empty(growable: true); var pendingCtrl = Get.put(ReviewerPendingListController()); @@ -138,6 +129,7 @@ class ReviewerSubmitController extends GetxController { (resp) { isProcessing(false); insightDebitur.value = resp; + getRating(); }, onError: (err) { isProcessing(false); Get.snackbar('Error', err.toString()); diff --git a/lib/app/modules/reviewer_submit/views/reviewer_submit_view.dart b/lib/app/modules/reviewer_submit/views/reviewer_submit_view.dart index d777f309..2aae39e5 100644 --- a/lib/app/modules/reviewer_submit/views/reviewer_submit_view.dart +++ b/lib/app/modules/reviewer_submit/views/reviewer_submit_view.dart @@ -229,11 +229,12 @@ class ReviewerSubmitView extends GetView { const SizedBox(height: 10), Text( 'Ini merupakan hasil inputan debitur yang telah diinputkan oleh analis, dan akan di review oleh anda sebagai reviewer.', - style: Theme.of(context).textTheme.bodySmall?.merge( - const TextStyle( - fontSize: 14, - ), - ), + style: + Theme.of(context).textTheme.bodySmall?.merge( + const TextStyle( + fontSize: 14, + ), + ), ), const SizedBox(height: 10), Obx( @@ -969,11 +970,12 @@ class ReviewerSubmitView extends GetView { const SizedBox(height: 10), Text( 'Ini adalah tanggapan analis terhadap pengajuan ini', - style: Theme.of(context).textTheme.bodySmall?.merge( - const TextStyle( - fontSize: 14, - ), - ), + style: + Theme.of(context).textTheme.bodySmall?.merge( + const TextStyle( + fontSize: 14, + ), + ), ), ListView.builder( shrinkWrap: true, @@ -1043,11 +1045,12 @@ class ReviewerSubmitView extends GetView { const SizedBox(height: 10), Text( 'Ini merupakan catatan dari reviewer terhadap pengajuan debitur', - style: Theme.of(context).textTheme.bodySmall?.merge( - const TextStyle( - fontSize: 14, - ), - ), + style: + Theme.of(context).textTheme.bodySmall?.merge( + const TextStyle( + fontSize: 14, + ), + ), ), const SizedBox(height: 10), Row( @@ -1295,7 +1298,26 @@ class AgunanCard extends StatelessWidget { }, color: primaryColor, shape: GFButtonShape.pills, - text: 'Lihat Summary Agunan', + text: 'Lihat Analisa Agunan', + icon: const Icon( + Icons.summarize, + size: 18, + color: secondaryColor, + ), + fullWidthButton: true, + size: GFSize.LARGE, + ), + const SizedBox( + height: 10.0, + ), + GFButton( + onPressed: () { + Get.toNamed(Routes.DETAIL_AGUNAN, + arguments: controller.insightDebitur.value); + }, + color: primaryColor, + shape: GFButtonShape.pills, + text: 'Lihat Detail Agunan', icon: const Icon( Icons.summarize, size: 18, diff --git a/lib/app/routes/app_pages.dart b/lib/app/routes/app_pages.dart index fcdb375e..b2f124a8 100644 --- a/lib/app/routes/app_pages.dart +++ b/lib/app/routes/app_pages.dart @@ -26,6 +26,8 @@ import '../modules/debitur_deploy/views/debitur_deploy_view.dart'; import '../modules/debitur_real/bindings/debitur_real_binding.dart'; import '../modules/debitur_real/views/debitur_edit_view.dart'; import '../modules/debitur_real/views/debitur_onboarding_view.dart'; +import '../modules/detail_agunan/bindings/detail_agunan_binding.dart'; +import '../modules/detail_agunan/views/detail_agunan_view.dart'; import '../modules/gallery_file/bindings/gallery_file_binding.dart'; import '../modules/gallery_file/views/gallery_file_view.dart'; import '../modules/gallery_image/bindings/gallery_image_binding.dart'; @@ -602,5 +604,10 @@ class AppPages { page: () => const PengutusPendingStatsView(), binding: PengutusPendingStatsBinding(), ), + GetPage( + name: _Paths.DETAIL_AGUNAN, + page: () => const DetailAgunanView(), + binding: DetailAgunanBinding(), + ), ]; } diff --git a/lib/app/routes/app_routes.dart b/lib/app/routes/app_routes.dart index d80b5cbe..53921a87 100644 --- a/lib/app/routes/app_routes.dart +++ b/lib/app/routes/app_routes.dart @@ -106,6 +106,7 @@ abstract class Routes { static const PENGUTUS_COMPLETED_LIST = _Paths.PENGUTUS_COMPLETED_LIST; static const PENGUTUS_PENDING_LIST = _Paths.PENGUTUS_PENDING_LIST; static const PENGUTUS_PENDING_STATS = _Paths.PENGUTUS_PENDING_STATS; + static const DETAIL_AGUNAN = _Paths.DETAIL_AGUNAN; } abstract class _Paths { @@ -210,4 +211,5 @@ abstract class _Paths { static const PENGUTUS_COMPLETED_LIST = '/pengutus-completed-list'; static const PENGUTUS_PENDING_LIST = '/pengutus-pending-list'; static const PENGUTUS_PENDING_STATS = '/pengutus-pending-stats'; + static const DETAIL_AGUNAN = '/detail-agunan'; } From 8e7b2ac76285b5ed37d68e5b4cf762ce771d0c53 Mon Sep 17 00:00:00 2001 From: Novian Andika Date: Wed, 8 Feb 2023 13:53:01 +0700 Subject: [PATCH 2/2] feat: modify pengajuan printing --- .../views/detail_agunan_view.dart | 619 +++++++++++++ .../views/home_pengutus_view.dart | 2 +- .../printing/inputan/inputan_export.dart | 15 - .../views/pengajuan_printing_view.dart | 869 +++++++++++++----- .../pengutus_submit_controller.dart | 10 +- .../views/pengutus_submit_view.dart | 19 + 6 files changed, 1257 insertions(+), 277 deletions(-) diff --git a/lib/app/modules/detail_agunan/views/detail_agunan_view.dart b/lib/app/modules/detail_agunan/views/detail_agunan_view.dart index 0ace7431..f431decc 100644 --- a/lib/app/modules/detail_agunan/views/detail_agunan_view.dart +++ b/lib/app/modules/detail_agunan/views/detail_agunan_view.dart @@ -9,6 +9,7 @@ import 'package:get/get.dart'; import 'package:getwidget/getwidget.dart'; import 'package:intl/intl.dart'; import 'package:latlong2/latlong.dart'; +import 'package:syncfusion_flutter_charts/charts.dart'; import '../controllers/detail_agunan_controller.dart'; @@ -76,6 +77,624 @@ class DetailAgunanView extends GetView { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + const Padding( + padding: EdgeInsets.all(8.0), + child: Text( + "Statistik Agunan", + style: TextStyle( + fontSize: 25.0, + fontWeight: FontWeight.bold, + ), + ), + ), + Card( + child: Container( + width: MediaQuery.of(context).size.width, + padding: const EdgeInsets.all(20.0), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + "Total Nilai Agunan", + style: TextStyle( + fontSize: 12.0, + ), + ), + const SizedBox( + height: 6.0, + ), + Row( + children: [ + Text( + MoneyMaskedTextController( + decimalSeparator: ',', + thousandSeparator: '.', + precision: 0, + leftSymbol: 'Rp. ', + initialValue: double.parse(controller + .args.analisaAgunan!.totalAgunan + .toString()), + ).text, + style: const TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ], + ), + ), + Container( + padding: const EdgeInsets.all(10.0), + decoration: const BoxDecoration( + color: Colors.orange, + borderRadius: BorderRadius.all( + Radius.circular( + 8.0, + ), + ), + ), + child: const Icon( + Icons.wallet, + size: 24.0, + color: Colors.white, + ), + ), + ], + ), + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Card( + child: Container( + width: MediaQuery.of(context).size.width, + padding: const EdgeInsets.all(20.0), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + "Tanah", + style: TextStyle( + fontSize: 12.0, + ), + ), + const SizedBox( + height: 6.0, + ), + Row( + children: [ + formAgunanTanah != null + ? Text( + formAgunanTanah.length + .toString(), + style: const TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + ), + ) + : const Text( + '0', + style: TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + ), + ) + ], + ), + ], + ), + ), + Container( + padding: const EdgeInsets.all(10.0), + decoration: const BoxDecoration( + color: Colors.red, + borderRadius: BorderRadius.all( + Radius.circular( + 8.0, + ), + ), + ), + child: const Icon( + Icons.home, + size: 24.0, + color: Colors.white, + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Card( + child: Container( + width: MediaQuery.of(context).size.width, + padding: const EdgeInsets.all(20.0), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + "Tanah dan Bangunan", + style: TextStyle( + fontSize: 12.0, + ), + ), + const SizedBox( + height: 6.0, + ), + Row( + children: [ + formAgunanTanah != null + ? Text( + formAgunanTanahBangunan!.length + .toString(), + style: const TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + ), + ) + : const Text( + "0", + style: TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + ), + ) + ], + ), + ], + ), + ), + Container( + padding: const EdgeInsets.all(10.0), + decoration: const BoxDecoration( + color: Colors.pink, + borderRadius: BorderRadius.all( + Radius.circular( + 8.0, + ), + ), + ), + child: const Icon( + Icons.landslide, + size: 24.0, + color: Colors.white, + ), + ), + ], + ), + ), + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Card( + child: Container( + width: MediaQuery.of(context).size.width, + padding: const EdgeInsets.all(20.0), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + "Kendaran", + style: TextStyle( + fontSize: 12.0, + ), + ), + const SizedBox( + height: 6.0, + ), + Row( + children: [ + formKendaraan != null + ? Text( + formKendaraan.length.toString(), + style: const TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + ), + ) + : const Text( + "0", + style: TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + ), + ) + ], + ), + ], + ), + ), + Container( + padding: const EdgeInsets.all(10.0), + decoration: const BoxDecoration( + color: Colors.indigo, + borderRadius: BorderRadius.all( + Radius.circular( + 8.0, + ), + ), + ), + child: const Icon( + Icons.motorcycle, + size: 24.0, + color: Colors.white, + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Card( + child: Container( + width: MediaQuery.of(context).size.width, + padding: const EdgeInsets.all(20.0), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + "Peralatan", + style: TextStyle( + fontSize: 12.0, + ), + ), + const SizedBox( + height: 6.0, + ), + Row( + children: [ + formPeralatan != null + ? Text( + formPeralatan.length.toString(), + style: const TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + ), + ) + : const Text( + "0", + style: TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + ), + ) + ], + ), + ], + ), + ), + Container( + padding: const EdgeInsets.all(10.0), + decoration: const BoxDecoration( + color: Colors.teal, + borderRadius: BorderRadius.all( + Radius.circular( + 8.0, + ), + ), + ), + child: const Icon( + Icons.build, + size: 24.0, + color: Colors.white, + ), + ), + ], + ), + ), + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Card( + child: Container( + width: MediaQuery.of(context).size.width, + padding: const EdgeInsets.all(20.0), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + "Cash Collateral", + style: TextStyle( + fontSize: 12.0, + ), + ), + const SizedBox( + height: 6.0, + ), + Row( + children: [ + formCash != null + ? Text( + formCash.length.toString(), + style: const TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + ), + ) + : const Text( + "0", + style: TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + ), + ) + ], + ), + ], + ), + ), + Container( + padding: const EdgeInsets.all(10.0), + decoration: const BoxDecoration( + color: Colors.lightGreen, + borderRadius: BorderRadius.all( + Radius.circular( + 8.0, + ), + ), + ), + child: const Icon( + Icons.account_balance_wallet, + size: 24.0, + color: Colors.white, + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Card( + child: Container( + width: MediaQuery.of(context).size.width, + padding: const EdgeInsets.all(20.0), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + "Los / Kios Pasar", + style: TextStyle( + fontSize: 12.0, + ), + ), + const SizedBox( + height: 6.0, + ), + Row( + children: [ + formLos != null + ? Text( + formLos.length.toString(), + style: const TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + ), + ) + : const Text( + "0", + style: TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + ), + ) + ], + ), + ], + ), + ), + Container( + padding: const EdgeInsets.all(10.0), + decoration: const BoxDecoration( + color: Colors.green, + borderRadius: BorderRadius.all( + Radius.circular( + 8.0, + ), + ), + ), + child: const Icon( + Icons.storefront, + size: 24.0, + color: Colors.white, + ), + ), + ], + ), + ), + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: Card( + child: Container( + width: MediaQuery.of(context).size.width, + padding: const EdgeInsets.all(20.0), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + "Lainnya", + style: TextStyle( + fontSize: 12.0, + ), + ), + const SizedBox( + height: 6.0, + ), + Row( + children: [ + formLainnya != null + ? Text( + formLainnya.length.toString(), + style: const TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + ), + ) + : const Text( + "0", + style: TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + ), + ) + ], + ), + ], + ), + ), + Container( + padding: const EdgeInsets.all(10.0), + decoration: const BoxDecoration( + color: Colors.black, + borderRadius: BorderRadius.all( + Radius.circular( + 8.0, + ), + ), + ), + child: const Icon( + Icons.corporate_fare, + size: 24.0, + color: Colors.white, + ), + ), + ], + ), + ), + ), + ), + Expanded( + flex: 1, + child: Container(), + ), + ], + ), + Builder( + builder: (context) { + final List chartData = [ + { + "status": "Tanah", + "value": formAgunanTanah == null + ? 0 + : formAgunanTanah.length, + }, + { + "status": "Tanah dan Bangunan", + "value": formAgunanTanahBangunan == null + ? 0 + : formAgunanTanahBangunan.length, + }, + { + "status": "Kendaraan", + "value": + formKendaraan == null ? 0 : formKendaraan.length, + }, + { + "status": "Peralatan", + "value": + formPeralatan == null ? 0 : formPeralatan.length, + }, + { + "status": "Cash Collateral", + "value": formCash == null ? 0 : formCash.length, + }, + { + "status": "Los / Kios Pasar", + "value": formLos == null ? 0 : formLos.length, + }, + { + "status": "Lainnya", + "value": formLainnya == null ? 0 : formLainnya.length, + }, + ]; + return Container( + color: Theme.of(context).cardColor, + padding: const EdgeInsets.all(12.0), + child: SfCircularChart( + title: ChartTitle(text: 'Jumlah Agunan'), + legend: Legend(isVisible: true), + backgroundColor: Colors.transparent, + series: [ + PieSeries( + dataSource: chartData, + enableTooltip: true, + dataLabelSettings: const DataLabelSettings( + isVisible: true, + showZeroValue: false, + textStyle: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold, + ), + borderColor: Colors.transparent, + ), + xValueMapper: (Map data, _) => data["status"], + yValueMapper: (Map data, _) => data["value"], + ) + ], + ), + ); + }, + ), + const SizedBox( + height: 10.0, + ), + const Padding( + padding: EdgeInsets.all(8.0), + child: Text( + "Detail Agunan", + style: TextStyle( + fontSize: 25.0, + fontWeight: FontWeight.bold, + ), + ), + ), formAgunanTanah != null ? Column( children: [ diff --git a/lib/app/modules/home_pengutus/views/home_pengutus_view.dart b/lib/app/modules/home_pengutus/views/home_pengutus_view.dart index 0fe71b51..a1b0ed38 100644 --- a/lib/app/modules/home_pengutus/views/home_pengutus_view.dart +++ b/lib/app/modules/home_pengutus/views/home_pengutus_view.dart @@ -603,7 +603,7 @@ class HomePengutusView extends GetView { height: 6.0, ), const Text( - "Pengajuan yang sudah di review", + "Pengajuan yang sudah di putuskan", style: TextStyle( fontSize: 15.0, ), diff --git a/lib/app/modules/insight_debitur/views/components/printing/inputan/inputan_export.dart b/lib/app/modules/insight_debitur/views/components/printing/inputan/inputan_export.dart index 652fd869..b391a12d 100644 --- a/lib/app/modules/insight_debitur/views/components/printing/inputan/inputan_export.dart +++ b/lib/app/modules/insight_debitur/views/components/printing/inputan/inputan_export.dart @@ -208,21 +208,6 @@ Future makeInputPdf(DebiturInsight debtor) async { pdf.addPage( MultiPage( - // pageTheme: PageTheme( - // buildForeground: (context) { - // return FullPage( - // ignoreMargins: true, - // child: Watermark.text( - // 'fleetime', - // style: TextStyle( - // color: PdfColors.grey, - // fontSize: 100, - // fontWeight: FontWeight.bold, - // ), - // ), - // ); - // }, - // ), footer: (context) => Container( alignment: Alignment.centerRight, margin: const EdgeInsets.only(top: 1.0 * PdfPageFormat.cm), diff --git a/lib/app/modules/pengajuan_printing/views/pengajuan_printing_view.dart b/lib/app/modules/pengajuan_printing/views/pengajuan_printing_view.dart index af8be209..589787ae 100644 --- a/lib/app/modules/pengajuan_printing/views/pengajuan_printing_view.dart +++ b/lib/app/modules/pengajuan_printing/views/pengajuan_printing_view.dart @@ -5,8 +5,6 @@ import 'package:akm/app/routes/app_pages.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; -import 'package:getwidget/getwidget.dart'; -import 'package:google_fonts/google_fonts.dart'; import '../controllers/pengajuan_printing_controller.dart'; @@ -37,334 +35,701 @@ class PengajuanPrintingView extends GetView { mainAxisSize: MainAxisSize.min, children: [ Column( - crossAxisAlignment: CrossAxisAlignment.start, children: [ - ClipRRect( - borderRadius: BorderRadius.circular(10), - child: GFTypography( - text: 'Inputan Print', - type: GFTypographyType.typo1, - backgroundImage: NetworkImage( - photoUrl, + Card( + color: Colors.green[100], + child: Container( + width: MediaQuery.of(context).size.width, + padding: const EdgeInsets.all(20.0), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + const Text( + "Print", + style: TextStyle( + fontSize: 12.0, + ), + ), + const SizedBox( + height: 6.0, + ), + Row( + children: const [ + Text( + "Inputan", + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ], + ), + ), + Container( + padding: const EdgeInsets.all(10.0), + decoration: BoxDecoration( + color: Colors.green[400], + borderRadius: const BorderRadius.all( + Radius.circular( + 8.0, + ), + ), + ), + child: const Icon( + Icons.edit_note, + size: 24.0, + color: Colors.white, + ), + ), + ], ), ), ), - const SizedBox(height: 10), - GFButton( - onPressed: () { - Get.toNamed(Routes.INPUT_PRINT, - arguments: controller.insightDebitur.value); - }, - color: primaryColor, - shape: GFButtonShape.pills, - text: 'Lihat Hasil Inputan', - icon: const Icon( - Icons.summarize_outlined, - size: 18, - color: secondaryColor, + Card( + child: ListTile( + leading: const CircleAvatar( + child: Icon(Icons.description), + ), + title: const Text("Cetak"), + subtitle: const Text("Hasil Inputan"), + trailing: IconButton( + onPressed: () { + Get.toNamed(Routes.INPUT_PRINT, + arguments: + controller.insightDebitur.value); + }, + icon: const Icon( + Icons.print, + size: 24.0, + ), + ), ), - fullWidthButton: true, - size: GFSize.LARGE, ), - const SizedBox(height: 10), - GFButton( - onPressed: () { - Get.toNamed(Routes.USULAN_PRINT, - arguments: controller.insightDebitur.value); - }, - color: primaryColor, - shape: GFButtonShape.pills, - text: 'Lihat Draft Usulan', - icon: const Icon( - Icons.summarize_outlined, - size: 18, - color: secondaryColor, + Card( + child: ListTile( + leading: const CircleAvatar( + child: Icon(Icons.drafts), + ), + title: const Text("Cetak"), + subtitle: const Text("Draft Usulan"), + trailing: IconButton( + onPressed: () { + Get.toNamed(Routes.USULAN_PRINT, + arguments: + controller.insightDebitur.value); + }, + icon: const Icon( + Icons.print, + size: 24.0, + ), + ), ), - fullWidthButton: true, - size: GFSize.LARGE, ), - const SizedBox(height: 10), - GFButton( - onPressed: () { - Get.toNamed(Routes.USULAN_BARU_PRINT, - arguments: controller.insightDebitur.value); - }, - color: primaryColor, - shape: GFButtonShape.pills, - text: 'Lihat Draft Usulan Baru', - icon: const Icon( - Icons.summarize_outlined, - size: 18, - color: secondaryColor, + Card( + child: ListTile( + leading: const CircleAvatar( + child: Icon(Icons.library_add), + ), + title: const Text("Cetak"), + subtitle: const Text("Draft Usulan Baru"), + trailing: IconButton( + onPressed: () { + Get.toNamed(Routes.USULAN_BARU_PRINT, + arguments: + controller.insightDebitur.value); + }, + icon: const Icon( + Icons.print, + size: 24.0, + ), + ), ), - fullWidthButton: true, - size: GFSize.LARGE, ), - const SizedBox(height: 10), - GFButton( - onPressed: () { - Get.toNamed(Routes.PUTUSAN_PRINT, - arguments: controller.insightDebitur.value); - }, - color: primaryColor, - shape: GFButtonShape.pills, - text: 'Lihat Draft Putusan', - icon: const Icon( - Icons.summarize_outlined, - size: 18, - color: secondaryColor, + Card( + child: ListTile( + leading: const CircleAvatar( + child: Icon(Icons.gavel), + ), + title: const Text("Cetak"), + subtitle: const Text(" Draft Putusan"), + trailing: IconButton( + onPressed: () { + Get.toNamed(Routes.PUTUSAN_PRINT, + arguments: + controller.insightDebitur.value); + }, + icon: const Icon( + Icons.print, + size: 24.0, + ), + ), ), - fullWidthButton: true, - size: GFSize.LARGE, ), ], ), const SizedBox(height: 25), Column( - crossAxisAlignment: CrossAxisAlignment.start, children: [ - ClipRRect( - borderRadius: BorderRadius.circular(10), - child: GFTypography( - text: 'Keuangan Print', - type: GFTypographyType.typo1, - backgroundImage: NetworkImage( - photoUrl, + Card( + color: Colors.red[100], + child: Container( + width: MediaQuery.of(context).size.width, + padding: const EdgeInsets.all(20.0), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + const Text( + "Print", + style: TextStyle( + fontSize: 12.0, + ), + ), + const SizedBox( + height: 6.0, + ), + Row( + children: const [ + Text( + "Analisa Keuangan", + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ], + ), + ), + Container( + padding: const EdgeInsets.all(10.0), + decoration: BoxDecoration( + color: Colors.red[400], + borderRadius: const BorderRadius.all( + Radius.circular( + 8.0, + ), + ), + ), + child: const Icon( + Icons.account_balance_wallet, + size: 24.0, + color: Colors.white, + ), + ), + ], ), ), ), - const SizedBox(height: 10), - GFButton( - onPressed: () { - Get.toNamed(Routes.RUGILABA_PRINT, - arguments: controller.insightDebitur.value); - }, - color: primaryColor, - shape: GFButtonShape.pills, - text: 'Lihat Laporan Keuangan', - icon: const Icon( - Icons.summarize, - size: 18, - color: secondaryColor, + Card( + child: ListTile( + leading: const CircleAvatar( + child: Icon(Icons.request_quote), + ), + title: const Text("Cetak"), + subtitle: const Text("Laporan Keuangan"), + trailing: IconButton( + onPressed: () { + Get.toNamed(Routes.RUGILABA_PRINT, + arguments: + controller.insightDebitur.value); + }, + icon: const Icon( + Icons.print, + size: 24.0, + ), + ), ), - fullWidthButton: true, - size: GFSize.LARGE, ), - const SizedBox(height: 10), - GFButton( - onPressed: () { - Get.toNamed(Routes.NERACA_PRINT, - arguments: controller.insightDebitur.value); - }, - color: primaryColor, - shape: GFButtonShape.pills, - text: 'Lihat Keterangan Neraca', - icon: const Icon( - Icons.summarize, - size: 18, - color: secondaryColor, + Card( + child: ListTile( + leading: const CircleAvatar( + child: Icon(Icons.local_police), + ), + title: const Text("Cetak"), + subtitle: const Text("Keterangan Neraca"), + trailing: IconButton( + onPressed: () { + Get.toNamed(Routes.NERACA_PRINT, + arguments: + controller.insightDebitur.value); + }, + icon: const Icon( + Icons.print, + size: 24.0, + ), + ), ), - fullWidthButton: true, - size: GFSize.LARGE, ), - const SizedBox(height: 10), - GFButton( - onPressed: () { - Get.toNamed(Routes.KEUANGAN_PRINT, - arguments: controller.insightDebitur.value); - }, - color: primaryColor, - shape: GFButtonShape.pills, - text: 'Lihat Analisa Keuangan', - icon: const Icon( - Icons.summarize, - size: 18, - color: secondaryColor, + Card( + child: ListTile( + leading: const CircleAvatar( + child: Icon(Icons.savings), + ), + title: const Text("Cetak"), + subtitle: const Text("Analisa Keuangan"), + trailing: IconButton( + onPressed: () { + Get.toNamed(Routes.KEUANGAN_PRINT, + arguments: + controller.insightDebitur.value); + }, + icon: const Icon( + Icons.print, + size: 24.0, + ), + ), ), - fullWidthButton: true, - size: GFSize.LARGE, ), ], ), const SizedBox(height: 25), Column( - crossAxisAlignment: CrossAxisAlignment.start, children: [ - ClipRRect( - borderRadius: BorderRadius.circular(10), - child: GFTypography( - text: 'Karakter Print', - type: GFTypographyType.typo1, - backgroundImage: NetworkImage( - photoUrl, + Card( + color: Colors.teal[100], + child: Container( + width: MediaQuery.of(context).size.width, + padding: const EdgeInsets.all(20.0), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + const Text( + "Print", + style: TextStyle( + fontSize: 12.0, + ), + ), + const SizedBox( + height: 6.0, + ), + Row( + children: const [ + Text( + "Analisa Karakter", + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ], + ), + ), + Container( + padding: const EdgeInsets.all(10.0), + decoration: BoxDecoration( + color: Colors.teal[400], + borderRadius: const BorderRadius.all( + Radius.circular( + 8.0, + ), + ), + ), + child: const Icon( + Icons.settings_accessibility, + size: 24.0, + color: Colors.white, + ), + ), + ], ), ), ), - const SizedBox(height: 10), - GFButton( - onPressed: () { - Get.toNamed(Routes.KARAKTER_PRINT, - arguments: controller.insightDebitur.value); - }, - text: 'Lihat Summary Karakter', - color: primaryColor, - shape: GFButtonShape.pills, - icon: const Icon( - Icons.summarize, - size: 18, - color: secondaryColor, + Card( + child: ListTile( + leading: const CircleAvatar( + child: Icon(Icons.face_4_outlined), + ), + title: const Text("Cetak"), + subtitle: const Text("Analisa Karakter"), + trailing: IconButton( + onPressed: () { + Get.toNamed(Routes.KARAKTER_PRINT, + arguments: + controller.insightDebitur.value); + }, + icon: const Icon( + Icons.print, + size: 24.0, + ), + ), ), - fullWidthButton: true, - size: GFSize.LARGE, ), ], ), const SizedBox(height: 25), Column( - crossAxisAlignment: CrossAxisAlignment.start, children: [ - ClipRRect( - borderRadius: BorderRadius.circular(10), - child: GFTypography( - text: 'Bisnis Print', - type: GFTypographyType.typo1, - backgroundImage: NetworkImage( - photoUrl, + Card( + color: Colors.deepOrange[100], + child: Container( + width: MediaQuery.of(context).size.width, + padding: const EdgeInsets.all(20.0), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + const Text( + "Print", + style: TextStyle( + fontSize: 12.0, + ), + ), + const SizedBox( + height: 6.0, + ), + Row( + children: const [ + Text( + "Analisa Bisnis", + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ], + ), + ), + Container( + padding: const EdgeInsets.all(10.0), + decoration: BoxDecoration( + color: Colors.deepOrange[400], + borderRadius: const BorderRadius.all( + Radius.circular( + 8.0, + ), + ), + ), + child: const Icon( + Icons.receipt_long, + size: 24.0, + color: Colors.white, + ), + ), + ], ), ), ), - const SizedBox(height: 10), - GFButton( - onPressed: () { - Get.toNamed(Routes.BISNIS_PRINT, - arguments: controller.insightDebitur.value); - }, - color: primaryColor, - shape: GFButtonShape.pills, - text: 'Lihat Summary Bisnis', - icon: const Icon( - Icons.summarize, - size: 18, - color: secondaryColor, + Card( + child: ListTile( + leading: const CircleAvatar( + child: Icon(Icons.receipt), + ), + title: const Text("Cetak"), + subtitle: const Text("Analisa Bisnis"), + trailing: IconButton( + onPressed: () { + Get.toNamed(Routes.BISNIS_PRINT, + arguments: + controller.insightDebitur.value); + }, + icon: const Icon( + Icons.print, + size: 24.0, + ), + ), ), - fullWidthButton: true, - size: GFSize.LARGE, ), ], ), const SizedBox(height: 25), Column( - crossAxisAlignment: CrossAxisAlignment.start, children: [ - ClipRRect( - borderRadius: BorderRadius.circular(10), - child: GFTypography( - text: 'Jenis Usaha Print', - type: GFTypographyType.typo1, - backgroundImage: NetworkImage( - photoUrl, + Card( + color: Colors.indigo[100], + child: Container( + width: MediaQuery.of(context).size.width, + padding: const EdgeInsets.all(20.0), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + const Text( + "Print", + style: TextStyle( + fontSize: 12.0, + ), + ), + const SizedBox( + height: 6.0, + ), + Row( + children: const [ + Text( + "Analisa Jenis Usaha", + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ], + ), + ), + Container( + padding: const EdgeInsets.all(10.0), + decoration: BoxDecoration( + color: Colors.indigo[400], + borderRadius: const BorderRadius.all( + Radius.circular( + 8.0, + ), + ), + ), + child: const Icon( + Icons.local_convenience_store, + size: 24.0, + color: Colors.white, + ), + ), + ], ), ), ), - const SizedBox(height: 10), - GFButton( - onPressed: () { - Get.toNamed(Routes.USAHA_PRINT, - arguments: controller.insightDebitur.value); - }, - text: 'Lihat Summary Jenis Usaha', - color: primaryColor, - shape: GFButtonShape.pills, - icon: const Icon( - Icons.summarize, - size: 18, - color: secondaryColor, + Card( + child: ListTile( + leading: const CircleAvatar( + child: Icon(Icons.shopping_bag), + ), + title: const Text("Cetak"), + subtitle: const Text("Analisa Jenis Usaha"), + trailing: IconButton( + onPressed: () { + Get.toNamed(Routes.USAHA_PRINT, + arguments: + controller.insightDebitur.value); + }, + icon: const Icon( + Icons.print, + size: 24.0, + ), + ), ), - fullWidthButton: true, - size: GFSize.LARGE, ), ], ), const SizedBox(height: 25), Column( - crossAxisAlignment: CrossAxisAlignment.start, children: [ - ClipRRect( - borderRadius: BorderRadius.circular(10), - child: GFTypography( - text: 'Gallery', - type: GFTypographyType.typo1, - backgroundImage: NetworkImage( - photoUrl, + Card( + color: Colors.lightBlueAccent[100], + child: Container( + width: MediaQuery.of(context).size.width, + padding: const EdgeInsets.all(20.0), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + const Text( + "Print", + style: TextStyle( + fontSize: 12.0, + ), + ), + const SizedBox( + height: 6.0, + ), + Row( + children: const [ + Text( + "Analisa Agunan", + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ], + ), + ), + Container( + padding: const EdgeInsets.all(10.0), + decoration: BoxDecoration( + color: Colors.lightBlueAccent[400], + borderRadius: const BorderRadius.all( + Radius.circular( + 8.0, + ), + ), + ), + child: const Icon( + Icons.landslide, + size: 24.0, + color: Colors.white, + ), + ), + ], ), ), ), - const SizedBox(height: 10), - GFButton( - onPressed: () { - Get.toNamed(Routes.GALLERY_IMAGE, - arguments: controller.insightDebitur.value); - }, - text: 'Lihat Gallery', - color: primaryColor, - shape: GFButtonShape.pills, - icon: const Icon( - Icons.image, - size: 18, - color: secondaryColor, + Card( + child: ListTile( + leading: const CircleAvatar( + child: Icon(Icons.landscape), + ), + title: const Text("Cetak"), + subtitle: const Text("Analisa Agunan"), + trailing: IconButton( + onPressed: () { + Get.toNamed(Routes.AGUNAN_PRINT, + arguments: + controller.insightDebitur.value); + }, + icon: const Icon( + Icons.print, + size: 24.0, + ), + ), ), - fullWidthButton: true, - size: GFSize.LARGE, ), - const SizedBox(height: 10), - Center( - child: SizedBox( - width: 200, + Card( + child: ListTile( + leading: const CircleAvatar( + child: Icon(Icons.forest), + ), + title: const Text("Lihat"), + subtitle: const Text("Detail Agunan"), + trailing: IconButton( + onPressed: () { + Get.toNamed(Routes.DETAIL_AGUNAN, + arguments: + controller.insightDebitur.value); + }, + icon: const Icon( + Icons.query_stats, + size: 24.0, + ), + ), + ), + ), + ], + ), + const SizedBox(height: 25), + Column( + children: [ + Card( + color: Colors.amber[100], + child: Container( + width: MediaQuery.of(context).size.width, + padding: const EdgeInsets.all(20.0), child: Row( children: [ - const Expanded( - child: Divider( - color: Colors.black, - thickness: 1, + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + const Text( + "Lihat", + style: TextStyle( + fontSize: 12.0, + ), + ), + const SizedBox( + height: 6.0, + ), + Row( + children: const [ + Text( + "Gallery", + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ], ), ), - Text( - " ATAU ", - style: TextStyle( - color: Colors.black, - fontSize: 15, - fontWeight: FontWeight.w800, - // add custom google font - fontFamily: - GoogleFonts.montserrat().fontFamily, + Container( + padding: const EdgeInsets.all(10.0), + decoration: BoxDecoration( + color: Colors.amberAccent[400], + borderRadius: const BorderRadius.all( + Radius.circular( + 8.0, + ), + ), ), - ), - const Expanded( - child: Divider( - color: Colors.black, - thickness: 1, + child: const Icon( + Icons.image, + size: 24.0, + color: Colors.white, ), ), ], ), ), ), - const SizedBox(height: 10), - GFButton( - onPressed: () { - Get.toNamed(Routes.GALLERY_FILE, - arguments: controller.insightDebitur.value); - }, - color: primaryColor, - shape: GFButtonShape.pills, - text: 'Lihat Dokumen', - icon: const Icon( - Icons.picture_as_pdf, - size: 18, - color: secondaryColor, + Card( + child: ListTile( + leading: const CircleAvatar( + child: Icon(Icons.photo_library), + ), + title: const Text("Lihat"), + subtitle: const Text("Foto Gallery"), + trailing: IconButton( + onPressed: () { + Get.toNamed(Routes.GALLERY_IMAGE, + arguments: + controller.insightDebitur.value); + }, + icon: const Icon( + Icons.visibility, + size: 24.0, + ), + ), + ), + ), + Card( + child: ListTile( + leading: const CircleAvatar( + child: Icon(Icons.picture_as_pdf), + ), + title: const Text("Lihat"), + subtitle: const Text("File Dokumen"), + trailing: IconButton( + onPressed: () { + Get.toNamed(Routes.GALLERY_FILE, + arguments: + controller.insightDebitur.value); + }, + icon: const Icon( + Icons.visibility, + size: 24.0, + ), + ), ), - fullWidthButton: true, - size: GFSize.LARGE, ), ], ), diff --git a/lib/app/modules/pengutus_submit/controllers/pengutus_submit_controller.dart b/lib/app/modules/pengutus_submit/controllers/pengutus_submit_controller.dart index 32017790..9c3e5af2 100644 --- a/lib/app/modules/pengutus_submit/controllers/pengutus_submit_controller.dart +++ b/lib/app/modules/pengutus_submit/controllers/pengutus_submit_controller.dart @@ -22,15 +22,6 @@ class PengutusSubmitController extends GetxController { super.onInit(); } - @override - void onReady() { - Future.delayed(const Duration(seconds: 5), () { - getRating(); - }); - - super.onReady(); - } - PengajuanDetail pengajuan = Get.arguments; var isProcessing = false.obs; @@ -141,6 +132,7 @@ class PengutusSubmitController extends GetxController { (resp) { isProcessing(false); insightDebitur.value = resp; + getRating(); }, onError: (err) { isProcessing(false); Get.snackbar('Error', err.toString()); diff --git a/lib/app/modules/pengutus_submit/views/pengutus_submit_view.dart b/lib/app/modules/pengutus_submit/views/pengutus_submit_view.dart index fe1b6f68..979e3be2 100644 --- a/lib/app/modules/pengutus_submit/views/pengutus_submit_view.dart +++ b/lib/app/modules/pengutus_submit/views/pengutus_submit_view.dart @@ -1360,6 +1360,25 @@ class AgunanCard extends StatelessWidget { fullWidthButton: true, size: GFSize.LARGE, ), + const SizedBox( + height: 10.0, + ), + GFButton( + onPressed: () { + Get.toNamed(Routes.DETAIL_AGUNAN, + arguments: controller.insightDebitur.value); + }, + color: Colors.pink, + shape: GFButtonShape.pills, + text: 'Lihat Detail Agunan', + icon: const Icon( + Icons.summarize, + size: 18, + color: secondaryColor, + ), + fullWidthButton: true, + size: GFSize.LARGE, + ), const SizedBox(height: 10), FormBuilderRadioGroup( name: 'agunan',