changes area to kecamatan and some changes
This commit is contained in:
@ -1,14 +1,14 @@
|
||||
class AreaListModel {
|
||||
List<AreaModel>? area;
|
||||
class KecamatanDetail {
|
||||
List<KecamatanModel>? kecamatan;
|
||||
int? jumlah;
|
||||
|
||||
AreaListModel({this.area, this.jumlah});
|
||||
KecamatanDetail({this.kecamatan, this.jumlah});
|
||||
|
||||
AreaListModel.fromJson(Map<String, dynamic> json) {
|
||||
if (json['area'] != null) {
|
||||
area = <AreaModel>[];
|
||||
json['area'].forEach((v) {
|
||||
area!.add(AreaModel.fromJson(v));
|
||||
KecamatanDetail.fromJson(Map<String, dynamic> json) {
|
||||
if (json['kecamatan'] != null) {
|
||||
kecamatan = <KecamatanModel>[];
|
||||
json['kecamatan'].forEach((v) {
|
||||
kecamatan!.add(KecamatanModel.fromJson(v));
|
||||
});
|
||||
}
|
||||
jumlah = json['jumlah'];
|
||||
@ -16,29 +16,77 @@ class AreaListModel {
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
if (area != null) {
|
||||
data['area'] = area!.map((v) => v.toJson()).toList();
|
||||
if (kecamatan != null) {
|
||||
data['kecamatan'] = kecamatan!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['jumlah'] = jumlah;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class AreaModel {
|
||||
int? idArea;
|
||||
String? namaArea;
|
||||
class KecamatanModel {
|
||||
String? kecamatanId;
|
||||
String? name;
|
||||
|
||||
AreaModel({this.idArea, this.namaArea});
|
||||
KecamatanModel({this.kecamatanId, this.name});
|
||||
|
||||
AreaModel.fromJson(Map<String, dynamic> json) {
|
||||
idArea = json['id_area'];
|
||||
namaArea = json['nama_area'];
|
||||
KecamatanModel.fromJson(Map<String, dynamic> json) {
|
||||
kecamatanId = json['kecamatan_id'];
|
||||
name = json['name'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id_area'] = idArea;
|
||||
data['nama_area'] = namaArea;
|
||||
data['kecamatan_id'] = kecamatanId;
|
||||
data['name'] = name;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class KelurahanDetail {
|
||||
List<KelurahanModel>? kelurahan;
|
||||
int? jumlah;
|
||||
|
||||
KelurahanDetail({this.kelurahan, this.jumlah});
|
||||
|
||||
KelurahanDetail.fromJson(Map<String, dynamic> json) {
|
||||
if (json['kelurahan'] != null) {
|
||||
kelurahan = <KelurahanModel>[];
|
||||
json['kelurahan'].forEach((v) {
|
||||
kelurahan!.add(KelurahanModel.fromJson(v));
|
||||
});
|
||||
}
|
||||
jumlah = json['jumlah'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
if (kelurahan != null) {
|
||||
data['kelurahan'] = kelurahan!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['jumlah'] = jumlah;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class KelurahanModel {
|
||||
String? kelurahanId;
|
||||
String? kecamatanId;
|
||||
String? name;
|
||||
|
||||
KelurahanModel({this.kelurahanId, this.kecamatanId, this.name});
|
||||
|
||||
KelurahanModel.fromJson(Map<String, dynamic> json) {
|
||||
kelurahanId = json['kelurahan_id'];
|
||||
kecamatanId = json['kecamatan_id'];
|
||||
name = json['name'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['kelurahan_id'] = kelurahanId;
|
||||
data['kecamatan_id'] = kecamatanId;
|
||||
data['name'] = name;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
import '../app/app.locator.dart';
|
||||
import '../services/other_function.dart';
|
||||
|
||||
class PemilihDetailModel {
|
||||
class PemilihDetail {
|
||||
List<PemilihModel>? pemilihModel;
|
||||
int? jumlah;
|
||||
|
||||
PemilihDetailModel({this.pemilihModel, this.jumlah});
|
||||
PemilihDetail({this.pemilihModel, this.jumlah});
|
||||
|
||||
PemilihDetailModel.fromJson(Map<String, dynamic> json) {
|
||||
PemilihDetail.fromJson(Map<String, dynamic> json) {
|
||||
if (json['data'] != null) {
|
||||
pemilihModel = <PemilihModel>[];
|
||||
json['data'].forEach((v) {
|
||||
@ -36,7 +36,9 @@ class PemilihModel {
|
||||
String? nikTimSurvei;
|
||||
String? namaTimSurvei;
|
||||
String? namaCaleg;
|
||||
String? namaArea;
|
||||
String? kecamatan;
|
||||
String? kelurahan;
|
||||
int? tps;
|
||||
String? createdAt;
|
||||
|
||||
PemilihModel(
|
||||
@ -46,7 +48,9 @@ class PemilihModel {
|
||||
this.nikTimSurvei,
|
||||
this.namaTimSurvei,
|
||||
this.namaCaleg,
|
||||
this.namaArea,
|
||||
this.kecamatan,
|
||||
this.kelurahan,
|
||||
this.tps,
|
||||
this.createdAt});
|
||||
|
||||
PemilihModel.fromJson(Map<String, dynamic> json) {
|
||||
@ -56,7 +60,9 @@ class PemilihModel {
|
||||
nikTimSurvei = json['nik_tim_survei'];
|
||||
namaTimSurvei = json['nama_tim_survei'];
|
||||
namaCaleg = json['nama_caleg'];
|
||||
namaArea = json['nama_area'];
|
||||
kecamatan = json['kecamatan'];
|
||||
kelurahan = json['kelurahan'];
|
||||
tps = json['tps'];
|
||||
createdAt = myFunction.convertDateTime(json['created_at']);
|
||||
}
|
||||
|
||||
@ -68,7 +74,9 @@ class PemilihModel {
|
||||
data['nik_tim_survei'] = nikTimSurvei;
|
||||
data['nama_tim_survei'] = namaTimSurvei;
|
||||
data['nama_caleg'] = namaCaleg;
|
||||
data['nama_area'] = namaArea;
|
||||
data['kecamatan'] = kecamatan;
|
||||
data['kelurahan'] = kelurahan;
|
||||
data['tps'] = tps;
|
||||
data['created_at'] = createdAt;
|
||||
return data;
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ class AreaTpsView extends StatelessWidget {
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
"Jumlah Area TPS : ",
|
||||
"Jumlah Kecamatan : ",
|
||||
style: italicTextStyle.copyWith(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
@ -56,7 +56,7 @@ class AreaTpsView extends StatelessWidget {
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'${model.jumlahArea} TPS',
|
||||
'${model.jumlahArea} Kecamatan',
|
||||
style: boldTextStyle.copyWith(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
@ -110,7 +110,7 @@ class AreaTpsView extends StatelessWidget {
|
||||
child: ListTile(
|
||||
leading: Text('${i + 1}'),
|
||||
title: Text(
|
||||
'${model.listAreaModel[i].namaArea}'),
|
||||
'${model.listKecamatanModel[i].name}'),
|
||||
trailing: IconButton(
|
||||
// trash bin icon
|
||||
icon: const Icon(
|
||||
@ -118,8 +118,8 @@ class AreaTpsView extends StatelessWidget {
|
||||
color: mainColor,
|
||||
),
|
||||
onPressed: () {
|
||||
model.cekSuara(
|
||||
model.listAreaModel[i]);
|
||||
model.cekSuara(model
|
||||
.listKecamatanModel[i]);
|
||||
},
|
||||
),
|
||||
),
|
||||
|
@ -7,7 +7,7 @@ import '../../../../model/my_response.model.dart';
|
||||
class AreaTpsViewModel extends CustomBaseViewModel {
|
||||
final log = getLogger('AreaTpsViewModel');
|
||||
|
||||
List<AreaModel> listAreaModel = [];
|
||||
List<KecamatanModel> listKecamatanModel = [];
|
||||
int jumlahArea = 0;
|
||||
bool status = false;
|
||||
|
||||
@ -23,12 +23,14 @@ class AreaTpsViewModel extends CustomBaseViewModel {
|
||||
try {
|
||||
var response = await httpService.get('/area/cek_area_caleg/$idCaleg');
|
||||
MyResponseModel myResponseModel = MyResponseModel.fromJson(response.data);
|
||||
AreaListModel areaListModel =
|
||||
AreaListModel.fromJson(myResponseModel.data);
|
||||
listAreaModel = areaListModel.area ?? [];
|
||||
log.i('listAreaModel: $listAreaModel');
|
||||
jumlahArea = listAreaModel.length;
|
||||
log.i('jumlahArea: $jumlahArea');
|
||||
// log.i('myResponseModel: ${myResponseModel.data}');
|
||||
KecamatanDetail kecamatanDetail =
|
||||
KecamatanDetail.fromJson(myResponseModel.data);
|
||||
// log.i('kecamatanDetail: ${kecamatanDetail.kecamatan}');
|
||||
listKecamatanModel = kecamatanDetail.kecamatan ?? [];
|
||||
|
||||
jumlahArea = kecamatanDetail.jumlah!;
|
||||
// log.i('jumlahArea: $jumlahArea');
|
||||
status = true;
|
||||
} catch (e) {
|
||||
log.e(e.toString());
|
||||
@ -38,13 +40,13 @@ class AreaTpsViewModel extends CustomBaseViewModel {
|
||||
}
|
||||
}
|
||||
|
||||
cekSuara(AreaModel areaModel) async {
|
||||
cekSuara(KecamatanModel kecamatanModel) async {
|
||||
await bottomSheetService.showCustomSheet(
|
||||
data: areaModel.idArea,
|
||||
data: kecamatanModel.kecamatanId,
|
||||
barrierDismissible: true,
|
||||
isScrollControlled: true,
|
||||
title: 'Detail Suara Area ${areaModel.namaArea}',
|
||||
description: 'Tim Survei',
|
||||
title: 'Detail Suara Kecamatan ${kecamatanModel.name}',
|
||||
description: 'Kecamatan',
|
||||
ignoreSafeArea: false,
|
||||
variant: BottomSheetType.detailSuaraBottomSheetView,
|
||||
);
|
||||
|
@ -111,8 +111,27 @@ class LogSuaraView extends StatelessWidget {
|
||||
model.listPemilih[i].namaPemilih!,
|
||||
style: boldTextStyle,
|
||||
),
|
||||
subtitle: Text(
|
||||
model.listPemilih[i].namaArea!,
|
||||
subtitle: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
CardWidget(
|
||||
title: 'Tim',
|
||||
value: model.listPemilih[i]
|
||||
.namaTimSurvei!),
|
||||
CardWidget(
|
||||
title: 'Kec',
|
||||
value: model
|
||||
.listPemilih[i].kecamatan!),
|
||||
CardWidget(
|
||||
title: 'Kel / Desa',
|
||||
value: model
|
||||
.listPemilih[i].kelurahan!),
|
||||
CardWidget(
|
||||
title: 'TPS',
|
||||
value: model.listPemilih[i].tps!
|
||||
.toString()),
|
||||
],
|
||||
),
|
||||
trailing: IconButton(
|
||||
icon: const Icon(
|
||||
@ -159,3 +178,48 @@ class LogSuaraView extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class CardWidget extends StatelessWidget {
|
||||
const CardWidget({
|
||||
super.key,
|
||||
required this.title,
|
||||
required this.value,
|
||||
});
|
||||
|
||||
final String title;
|
||||
final String value;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Text(
|
||||
title,
|
||||
style: italicTextStyle.copyWith(
|
||||
fontSize: 12,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
const Expanded(
|
||||
flex: 1,
|
||||
child: Text(
|
||||
' : ',
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 6,
|
||||
child: Text(
|
||||
value,
|
||||
style: boldTextStyle.copyWith(
|
||||
fontSize: 12,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -22,9 +22,9 @@ class LogSuaraViewModel extends CustomBaseViewModel {
|
||||
try {
|
||||
var response = await httpService.get('caleg/suara/$idCaleg');
|
||||
MyResponseModel myResponseModel = MyResponseModel.fromJson(response.data);
|
||||
PemilihDetailModel pemilihDetailModel =
|
||||
PemilihDetailModel.fromJson(myResponseModel.data);
|
||||
listPemilih = pemilihDetailModel.pemilihModel!;
|
||||
PemilihDetail pemilihDetail =
|
||||
PemilihDetail.fromJson(myResponseModel.data);
|
||||
listPemilih = pemilihDetail.pemilihModel!;
|
||||
counter = listPemilih.length;
|
||||
|
||||
status = true;
|
||||
|
@ -46,12 +46,12 @@ class PengaturanCalegView extends StatelessWidget {
|
||||
background: warningColor,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
TopContainer(
|
||||
title: 'Area\nTPS',
|
||||
value: '${model.suaraCounter} TPS',
|
||||
icon: Icons.location_on_outlined,
|
||||
background: orangeColor,
|
||||
),
|
||||
// TopContainer(
|
||||
// title: 'Area\nTPS',
|
||||
// value: '${model.suaraCounter} TPS',
|
||||
// icon: Icons.location_on_outlined,
|
||||
// background: orangeColor,
|
||||
// ),
|
||||
const SizedBox(height: 10),
|
||||
TopContainer(
|
||||
title: 'Jumlah Tim Survei',
|
||||
|
@ -2,8 +2,8 @@ import 'package:flutter/material.dart';
|
||||
import 'package:stacked/stacked.dart';
|
||||
import 'package:stacked_services/stacked_services.dart';
|
||||
|
||||
import '../../../app/themes/app_colors.dart';
|
||||
import '../../../app/themes/app_text.dart';
|
||||
import '../../../../app/themes/app_colors.dart';
|
||||
import '../../../../app/themes/app_text.dart';
|
||||
import './detail_suara_bottom_sheet_view_model.dart';
|
||||
|
||||
class DetailSuaraBottomSheetView extends StatelessWidget {
|
||||
@ -88,13 +88,22 @@ class DetailSuaraBottomSheetView extends StatelessWidget {
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (request!.description == 'Caleg')
|
||||
Text(
|
||||
model.listPemilih[i].namaTimSurvei!,
|
||||
style: italicTextStyle,
|
||||
),
|
||||
Text(
|
||||
model.listPemilih[i].namaArea!,
|
||||
),
|
||||
CardWidget(
|
||||
title: 'Tim',
|
||||
value: model
|
||||
.listPemilih[i].namaTimSurvei!),
|
||||
CardWidget(
|
||||
title: 'Kec',
|
||||
value:
|
||||
model.listPemilih[i].kecamatan!),
|
||||
CardWidget(
|
||||
title: 'Kel / Desa',
|
||||
value:
|
||||
model.listPemilih[i].kelurahan!),
|
||||
CardWidget(
|
||||
title: 'TPS',
|
||||
value: model.listPemilih[i].tps!
|
||||
.toString()),
|
||||
],
|
||||
),
|
||||
trailing: IconButton(
|
||||
@ -139,3 +148,48 @@ class DetailSuaraBottomSheetView extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class CardWidget extends StatelessWidget {
|
||||
const CardWidget({
|
||||
super.key,
|
||||
required this.title,
|
||||
required this.value,
|
||||
});
|
||||
|
||||
final String title;
|
||||
final String value;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Text(
|
||||
title,
|
||||
style: italicTextStyle.copyWith(
|
||||
fontSize: 12,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
const Expanded(
|
||||
flex: 1,
|
||||
child: Text(
|
||||
' : ',
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 6,
|
||||
child: Text(
|
||||
value,
|
||||
style: boldTextStyle.copyWith(
|
||||
fontSize: 12,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -29,11 +29,11 @@ class DetailSuaraBottomSheetViewModel extends CustomBaseViewModel {
|
||||
|
||||
var response = await httpService.get(url);
|
||||
MyResponseModel myResponseModel = MyResponseModel.fromJson(response.data);
|
||||
PemilihDetailModel pemilihDetailModel =
|
||||
PemilihDetailModel.fromJson(myResponseModel.data);
|
||||
PemilihDetail pemilihDetail =
|
||||
PemilihDetail.fromJson(myResponseModel.data);
|
||||
|
||||
listPemilih = pemilihDetailModel.pemilihModel!;
|
||||
counter = pemilihDetailModel.jumlah!;
|
||||
listPemilih = pemilihDetail.pemilihModel!;
|
||||
counter = pemilihDetail.jumlah!;
|
||||
this.status = true;
|
||||
} catch (e) {
|
||||
this.status = false;
|
||||
|
@ -41,69 +41,83 @@ class DetailSuaraPemilihBottomSheetView extends StatelessWidget {
|
||||
topRight: Radius.circular(16.0),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
request.title!,
|
||||
style: boldTextStyle.copyWith(
|
||||
fontSize: 16,
|
||||
color: fontColor,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
request.title!,
|
||||
style: boldTextStyle.copyWith(
|
||||
fontSize: 16,
|
||||
color: fontColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
Container(
|
||||
height: 100,
|
||||
width: 150,
|
||||
decoration: BoxDecoration(
|
||||
color: mainColor,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
model.showImage(
|
||||
context,
|
||||
dotenv.env['url']! + request.data!.img!,
|
||||
);
|
||||
},
|
||||
child: ClipRRect(
|
||||
const SizedBox(height: 15),
|
||||
Container(
|
||||
height: 100,
|
||||
width: 150,
|
||||
decoration: BoxDecoration(
|
||||
color: mainColor,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
child: Image.network(
|
||||
dotenv.env['url']! + request.data!.img!,
|
||||
fit: BoxFit.fill,
|
||||
errorBuilder: (context, error, stackTrace) {
|
||||
return const Center(
|
||||
child: Icon(
|
||||
Icons.error,
|
||||
color: backgroundColor,
|
||||
size: 50,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
model.showImage(
|
||||
context,
|
||||
dotenv.env['url']! + request.data!.img!,
|
||||
);
|
||||
},
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
child: Image.network(
|
||||
dotenv.env['url']! + request.data!.img!,
|
||||
fit: BoxFit.fill,
|
||||
errorBuilder: (context, error, stackTrace) {
|
||||
return const Center(
|
||||
child: Icon(
|
||||
Icons.error,
|
||||
color: backgroundColor,
|
||||
size: 50,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
_DetailChildWidget(
|
||||
title: 'Nama',
|
||||
value: request.data!.namaPemilih!,
|
||||
),
|
||||
_DetailChildWidget(
|
||||
title: 'No KTP /\nNo HP',
|
||||
value: request.data!.nikNomorHp!,
|
||||
),
|
||||
_DetailChildWidget(
|
||||
title: 'Tanggal/\nWaktu',
|
||||
value: model.myFunction
|
||||
.convertDateTime2(request.data!.createdAt!),
|
||||
),
|
||||
_DetailChildWidget(
|
||||
title: 'Caleg', value: request.data!.namaCaleg!),
|
||||
_DetailChildWidget(
|
||||
title: 'Tim Survei',
|
||||
value: request.data!.namaTimSurvei!,
|
||||
),
|
||||
],
|
||||
_DetailChildWidget(
|
||||
title: 'Nama',
|
||||
value: request.data!.namaPemilih!,
|
||||
),
|
||||
_DetailChildWidget(
|
||||
title: 'No KTP /\nNo HP',
|
||||
value: request.data!.nikNomorHp!,
|
||||
),
|
||||
_DetailChildWidget(
|
||||
title: 'Tanggal/\nWaktu',
|
||||
value: model.myFunction
|
||||
.convertDateTime2(request.data!.createdAt!),
|
||||
),
|
||||
_DetailChildWidget(
|
||||
title: 'Caleg', value: request.data!.namaCaleg!),
|
||||
_DetailChildWidget(
|
||||
title: 'Tim Survei',
|
||||
value: request.data!.namaTimSurvei!,
|
||||
),
|
||||
_DetailChildWidget(
|
||||
title: 'Kecamatan',
|
||||
value: request.data!.kecamatan!,
|
||||
),
|
||||
_DetailChildWidget(
|
||||
title: 'Kelurahan',
|
||||
value: request.data!.kelurahan!,
|
||||
),
|
||||
_DetailChildWidget(
|
||||
title: 'TPS',
|
||||
value: request.data!.tps!.toString(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -25,15 +25,21 @@ class LoginScreenViewModel extends CustomBaseViewModel {
|
||||
globalVar.backPressed = 'cantBack';
|
||||
|
||||
try {
|
||||
// log.i('username: ${usernameController.text}');
|
||||
// log.i('password: ${passwordController.text}');
|
||||
var formData = FormData.fromMap({
|
||||
'username': usernameController.text,
|
||||
'password': passwordController.text,
|
||||
});
|
||||
// log.i('formData: $formData');
|
||||
var response =
|
||||
await httpService.postWithFormData('login/caleg', formData);
|
||||
|
||||
// log.i('response: ${response.data}');
|
||||
|
||||
MyResponseModel myResponseModel = MyResponseModel.fromJson(response.data);
|
||||
var data = myResponseModel.data;
|
||||
// log.i('data: $data');
|
||||
CalegModel calegModel = CalegModel.fromJson(data);
|
||||
// log.i('calegModel: ${calegModel.toJson()}');
|
||||
await mySharedPrefs.setString('id', calegModel.idCaleg!.toString());
|
||||
|
Reference in New Issue
Block a user