import '../../model/sex_model.dart'; import '../model/person_ktp_model.dart'; import '../model/edit_person_model.dart'; import 'base_repository.dart'; class ScanRepository extends BaseRepository { ScanRepository({required super.dio}); Future> listRiwayatScanRepo({ required String host, required String userId, }) async { // final service = "${Constant.baseUrl}xauth/login"; final service = "http://${host}/one-api/scan-ktp/Scanktp/listRiwayatScan"; final resp = await post(param: { "userId":userId }, service: service); final result = List.empty(growable: true); resp['data'].forEach((e) { final model = PersonKtp.fromJson(e); result.add(model); }); return result; } Future prosesScan({ required String host, required String base64File, required String userId, }) async { final service = "http://${host}/one-api/scan-ktp/Scanktp/proses_scan"; final resp = await post(param: { "base64File": base64File, "userId": userId, }, service: service); if (resp['status'] == "OK") { return "Sukses Upload File"; } else { resp['message']; } return resp['message']; } // sex Future> sexRepo({ required String host, }) async { // final service = "${Constant.baseUrl}xauth/login"; final service = "http://${host}/one-api/scan-ktp/Scanktp/getSex"; final resp = await post(param: {}, service: service); final result = List.empty(growable: true); resp['data'].forEach((e) { final model = SexModel.fromJson(e); result.add(model); }); return result; } }