diff --git a/.env b/.env index 65b6be7..d60dafa 100644 --- a/.env +++ b/.env @@ -1,6 +1,6 @@ # url = 'http://172.29.85.181:3002/' # api_url = 'http://172.29.85.181:3002/' -# url = 'https://caleg_backend.kicap-karan.com/' -# api_url = 'https://caleg_backend.kicap-karan.com/' -url = 'http://20.20.20.25:3002/' -api_url = 'http://20.20.20.25:3002/' \ No newline at end of file +url = 'https://caleg_backend.kicap-karan.com/' +api_url = 'https://caleg_backend.kicap-karan.com/' +# url = 'http://20.20.20.25:3002/' +# api_url = 'http://20.20.20.25:3002/' \ No newline at end of file diff --git a/.gitignore b/.gitignore index 67302e5..27ad698 100644 --- a/.gitignore +++ b/.gitignore @@ -45,4 +45,5 @@ app.*.map.json # .env -.env.git \ No newline at end of file +.env +.git \ No newline at end of file diff --git a/README.md b/README.md index eec2ab6..c35984c 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,7 @@ # cek_suara -A new Flutter project. +## Aplikasi untuk admin yang mengatur caleg dan tim survei caleg -## Getting Started +## http://www.kicap-karan.com -This project is a starting point for a Flutter application. - -A few resources to get you started if this is your first Flutter project: - -- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) - -For help getting started with Flutter development, view the -[online documentation](https://docs.flutter.dev/), which offers tutorials, -samples, guidance on mobile development, and a full API reference. +## 082293246583 diff --git a/lib/ui/views/admin_index_tracking/admin_first_page/admin_first_page_view.dart b/lib/ui/views/admin_index_tracking/admin_first_page/admin_first_page_view.dart index dff7959..f1df06a 100644 --- a/lib/ui/views/admin_index_tracking/admin_first_page/admin_first_page_view.dart +++ b/lib/ui/views/admin_index_tracking/admin_first_page/admin_first_page_view.dart @@ -60,9 +60,9 @@ class AdminFirstPageView extends StatelessWidget { background: orangeColor, ), const SizedBox(height: 10), - const TopContainer( + TopContainer( title: 'Jumlah\nPemilih', - value: '10 Pemilih', + value: '${model.jumlahPemilih} Pemilih', icon: Icons.people_alt_outlined, background: blueColor, ), diff --git a/lib/ui/views/admin_index_tracking/admin_first_page/admin_first_page_view_model.dart b/lib/ui/views/admin_index_tracking/admin_first_page/admin_first_page_view_model.dart index f6b4bcf..fccce8b 100644 --- a/lib/ui/views/admin_index_tracking/admin_first_page/admin_first_page_view_model.dart +++ b/lib/ui/views/admin_index_tracking/admin_first_page/admin_first_page_view_model.dart @@ -1,5 +1,3 @@ -import 'package:cek_suara/model/area_model.dart'; - import '../../../../app/app.logger.dart'; import '../../../../app/core/custom_base_view_model.dart'; import '../../../../model/caleg_model.dart'; @@ -10,7 +8,7 @@ class AdminFirstPageViewModel extends CustomBaseViewModel { final log = getLogger('AdminFirstPageViewModel'); // variabel - int jumlahArea = 0; + int jumlahPemilih = 0; int jumlahCaleg = 0; int jumlahTimSurvei = 0; bool status = false; @@ -25,16 +23,16 @@ class AdminFirstPageViewModel extends CustomBaseViewModel { setBusy(true); globalVar.backPressed = 'cantBack'; try { - var response = await httpService.get('area/kecamatan'); + // var response = await httpService.get('area/kecamatan'); + // log.i(response.data); + // MyResponseModel myResponseModel = MyResponseModel.fromJson(response.data); + // KecamatanDetail areaListModel = + // KecamatanDetail.fromJson(myResponseModel.data); + // jumlahArea = areaListModel.jumlah!; + + var response = await httpService.get('caleg'); log.i(response.data); MyResponseModel myResponseModel = MyResponseModel.fromJson(response.data); - KecamatanDetail areaListModel = - KecamatanDetail.fromJson(myResponseModel.data); - jumlahArea = areaListModel.jumlah!; - - response = await httpService.get('caleg'); - log.i(response.data); - myResponseModel = MyResponseModel.fromJson(response.data); CalegListModel calegListModel = CalegListModel.fromJson(myResponseModel.data); jumlahCaleg = calegListModel.jumlah!; @@ -44,6 +42,11 @@ class AdminFirstPageViewModel extends CustomBaseViewModel { TimSurveiListModel timSurveiListModel = TimSurveiListModel.fromJson(myResponseModel.data); jumlahTimSurvei = timSurveiListModel.jumlah!; + + response = await httpService.get('pemilih'); + myResponseModel = MyResponseModel.fromJson(response.data); + Map data = myResponseModel.data; + jumlahPemilih = data['jumlah']; status = true; } catch (e) { status = false;