Fakultas Ilmu Komputer UI

Commit c0535a6f authored by Muhammad Farhan Ghaffar's avatar Muhammad Farhan Ghaffar
Browse files

feat: adding code FE for API get foto

parent d565045e
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_keyboard_visibility","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility-5.0.0\\\\","dependencies":[]},{"name":"flutter_secure_storage","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-3.3.5\\\\","dependencies":[]},{"name":"image_picker","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker-0.7.4\\\\","dependencies":[]},{"name":"path_provider","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]}],"android":[{"name":"flutter_keyboard_visibility","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility-5.0.0\\\\","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_plugin_android_lifecycle-2.0.1\\\\","dependencies":[]},{"name":"flutter_secure_storage","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-3.3.5\\\\","dependencies":[]},{"name":"image_picker","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker-0.7.4\\\\","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"path_provider","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-2.0.0\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-2.0.0\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-2.0.0\\\\","dependencies":[]}],"web":[{"name":"flutter_keyboard_visibility_web","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility_web-2.0.0\\\\","dependencies":[]},{"name":"image_picker_for_web","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker_for_web-2.0.0\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_keyboard_visibility","dependencies":["flutter_keyboard_visibility_web"]},{"name":"flutter_keyboard_visibility_web","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"flutter_secure_storage","dependencies":[]},{"name":"image_picker","dependencies":["flutter_plugin_android_lifecycle","image_picker_for_web"]},{"name":"image_picker_for_web","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2021-06-25 16:49:57.940427","version":"2.1.0-12.1.pre"}
\ No newline at end of file
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_keyboard_visibility","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility-5.0.0\\\\","dependencies":[]},{"name":"flutter_secure_storage","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-3.3.5\\\\","dependencies":[]},{"name":"image_picker","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker-0.7.4\\\\","dependencies":[]},{"name":"path_provider","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]}],"android":[{"name":"flutter_keyboard_visibility","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility-5.0.0\\\\","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_plugin_android_lifecycle-2.0.1\\\\","dependencies":[]},{"name":"flutter_secure_storage","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-3.3.5\\\\","dependencies":[]},{"name":"image_picker","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker-0.7.4\\\\","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"path_provider","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-2.0.0\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-2.0.0\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-2.0.0\\\\","dependencies":[]}],"web":[{"name":"flutter_keyboard_visibility_web","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility_web-2.0.0\\\\","dependencies":[]},{"name":"image_picker_for_web","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker_for_web-2.0.0\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_keyboard_visibility","dependencies":["flutter_keyboard_visibility_web"]},{"name":"flutter_keyboard_visibility_web","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"flutter_secure_storage","dependencies":[]},{"name":"image_picker","dependencies":["flutter_plugin_android_lifecycle","image_picker_for_web"]},{"name":"image_picker_for_web","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2021-06-26 22:14:27.589846","version":"2.1.0-12.1.pre"}
\ No newline at end of file
......@@ -1228,11 +1228,11 @@ class Api {
Future getFotoMemberDoc(int id) async {
var apiURL =
Uri.parse('https://canary.fundex.id/api/v1.1/member-documents/:$id/private');
Uri.parse('https://canary.fundex.id/api/v1.1/member-documents/$id/private');
var token = await secureStorage.readSecureData('accessToken');
var headers = {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
'Authorization': 'Bearer $token',
};
var apiResult = await client.get(apiURL, headers: headers);
print(await secureStorage.readSecureData('accessToken'));
......
......@@ -180,6 +180,7 @@ class _AlamatBodyState extends State<AlamatBody> {
getcity = jsonAddress['city'];
getprovince = jsonAddress['province'];
getzipcode = jsonAddress['zip_code'];
getdomicileaddressid = jsonAddress['domicile_address_id'];
setState(() {
this.distr= distr;
......@@ -192,6 +193,7 @@ class _AlamatBodyState extends State<AlamatBody> {
this.getcity = getcity;
this.getprovince = getprovince;
this.getzipcode = getzipcode;
this.getdomicileaddressid = getdomicileaddressid;
// this.getdomicileaddressid = getdomicileaddressid;
// this.getenabledomicile = getenabledomicile;
if (alreadyFilledSection) {
......@@ -785,24 +787,25 @@ class _AlamatBodyState extends State<AlamatBody> {
Api().putAddress(
idAddress, _alamatLengkap, _pilihKecamatan,
_pilihKabupaten, _selectedCity, _kodePos);
// if (_checkBox == true) {
// Api().putAddress(
// idAddress, _alamatLengkap, _pilihKecamatan,
// _pilihKabupaten, _selectedCity, _kodePos);
// }
// Api().put_kyc_progress(idKYC, true, true, false, false, false);
if (_checkBox == true) {
Api().putAddress(
getdomicileaddressid, _alamatLengkap, _pilihKecamatan,
_pilihKabupaten, _selectedCity, _kodePos);
}
}
else {
print(
"button Selanjutnya masuk POST");
Api().postAddress(_alamatLengkap, kecamatan, kabupaten, provinsi, _kodePos);
Api().kyc_progress(true, true, false, false, false);
if (_checkBox == true) {
Api().enable_domicile();
Api().postAddress(_alamatDomisili, kecamatanTambahan,
kabupatenTambahan, provinsiTambahan, _kodePosTambahan);
Api().domicile_address_id();
}
Api().postAddress(_alamatLengkap, kecamatan, kabupaten, provinsi, _kodePos);
Api().domicile_address_id();
Api().kyc_progress(true, true, false, false, false);
Api().kyc_progress(
true, true, false, false, false);
}
Navigator.push(context,
......
......@@ -791,8 +791,8 @@ class _BiodataBodyState extends State<BiodataBody> {
Api().birthdate(strDate, idbirthdate);
print(strDate);
// Api().kyc_progress(
// true, false, false, false, false);
Api().kyc_progress(
true, false, false, false, false);
}
Navigator.push(context,
......
......@@ -784,8 +784,8 @@ class _BiodataKeluargaBodyState extends State<BiodataKeluarga> {
Api().heir_relation(_hubunganAhli);
Api().heir_phone(_nomorHandphone);
Api().heir_address(_alamatAhli);
// Api().put_kyc_progress(idKYC, true,
// true, true, false, false);
Api().kyc_progress(
true, true, true, false, false);
}
Navigator.push(context,
......
......@@ -452,6 +452,8 @@ class _DataPendukungState extends State<DataPendukung> {
// Api().position(val);
// }
// Api().motivation(finalTujuanInvestasiList);
Api().kyc_progress(
true, true, true, true, true);
}
Navigator.push(context, MaterialPageRoute(builder: (context) {
......
......@@ -30,10 +30,10 @@ class Validasi {
}
}
var getFotoKtp;
var getFotoNpwp;
var getFotoSelfie;
var getFotoSelfieKtp;
// var getFotoKtp;
// var getFotoNpwp;
// var getFotoSelfie;
// var getFotoSelfieKtp;
class _DataIdentitasState extends State<DataIdentitas> {
final GlobalKey<FormState> _formkey = GlobalKey<FormState>();
TextEditingController _formNomorKTP = TextEditingController();
......@@ -58,6 +58,10 @@ class _DataIdentitasState extends State<DataIdentitas> {
int getIdNoNPWP;
String getNoKTP;
String getNoNPWP;
var getFotoKtp;
var getFotoNpwp;
var getFotoSelfie;
var getFotoSelfieKtp;
var getIdFotoKTPMemberAttr;
var getIdFotoKTPMemberDoc;
var getIdFotoNPWPMemberAttr;
......@@ -127,13 +131,17 @@ class _DataIdentitasState extends State<DataIdentitas> {
}
}
// getFotoKtp = await Api().getFotoMemberDoc(int.parse(getIdFotoKTPMemberDoc));
// getFotoNpwp = await Api().getFotoMemberDoc(int.parse(getIdFotoNPWPMemberDoc));
// getFotoSelfie = await Api().getFotoMemberDoc(int.parse(getIdFotoSelfieMemberDoc));
// getFotoSelfieKtp = await Api().getFotoMemberDoc(int.parse(getIdFotoSelfieKtpMemberDoc));
getFotoKtp = await Api().getFotoMemberDoc(int.parse(getIdFotoKTPMemberDoc));
getFotoNpwp = await Api().getFotoMemberDoc(int.parse(getIdFotoNPWPMemberDoc));
getFotoSelfie = await Api().getFotoMemberDoc(int.parse(getIdFotoSelfieMemberDoc));
getFotoSelfieKtp = await Api().getFotoMemberDoc(int.parse(getIdFotoSelfieKtpMemberDoc));
setState(() {
if (alreadyFilledSection) {
this.getFotoKtp = getFotoKtp;
this.getFotoNpwp = getFotoNpwp;
this.getFotoSelfie = getFotoSelfie;
this.getFotoSelfieKtp = getFotoSelfieKtp;
_formNomorKTP.text = getNoKTP;
_formNomorNPWP.text = getNoNPWP;
}
......@@ -647,10 +655,17 @@ class _DataIdentitasState extends State<DataIdentitas> {
print(fileNameFotoSelfie);
print(fileNameFotoSelfieDenganKTP);
Api().identity_number(_noKTP);
Api().npwp_number(_noPWP);
if (alreadyFilledSection == true) {
Api().putMemberAttribute(getIdNoKTP,
'identity_number', _noKTP);
Api().putMemberAttribute(getIdNoNPWP,
'npwp_number', _noPWP);
} else {
Api().identity_number(_noKTP);
Api().npwp_number(_noPWP);
Api().kyc_progress(
true, true, true, true, false);
}
Navigator.push(context,
MaterialPageRoute(
......@@ -705,11 +720,11 @@ class _DataIdentitasState extends State<DataIdentitas> {
),
onPressed: _openCameraKTP,
child: _imageFileKTP == null
? new Image.asset('assets/images/camera-icon.png',
? (getFotoKtp == null ? new Image.asset('assets/images/camera-icon.png',
key: Key('cameraIconKTP'))
: getFotoKtp == null ? Image.file(File(_imageFileKTP.path))
: getFotoKtp
),
: Image.network(getFotoKtp))
: Image.file(File(_imageFileKTP.path))
)
),
strokeWidth: 1.0,
dashPattern: [8, 10],
......@@ -733,10 +748,12 @@ class _DataIdentitasState extends State<DataIdentitas> {
onPrimary: white,
),
onPressed: _openCameraNPWP,
child: _imageFileNPWP == null
? new Image.asset('assets/images/camera-icon.png',
key: Key('cameraIconNPWP'))
: Image.file(File(_imageFileNPWP.path))),
child: _imageFileNPWP == null
? (getFotoNpwp == null ? new Image.asset('assets/images/camera-icon.png',
key: Key('cameraIconNPWP'))
: Image.network(getFotoNpwp))
: Image.file(File(_imageFileNPWP.path))
)
),
strokeWidth: 1.0,
dashPattern: [8, 10],
......@@ -761,9 +778,11 @@ class _DataIdentitasState extends State<DataIdentitas> {
),
onPressed: _openCameraFotoSelfie,
child: _imageFileFotoSelfie == null
? new Image.asset('assets/images/camera-icon.png',
key: Key('cameraIconFS'))
: Image.file(File(_imageFileFotoSelfie.path))),
? (getFotoSelfie == null ? new Image.asset('assets/images/camera-icon.png',
key: Key('cameraIconFS'))
: Image.network(getFotoSelfie))
: Image.file(File(_imageFileFotoSelfie.path))
)
),
strokeWidth: 1.0,
dashPattern: [8, 10],
......@@ -788,9 +807,11 @@ class _DataIdentitasState extends State<DataIdentitas> {
),
onPressed: _openCameraFotoSelfieDenganKTP,
child: _imageFileFotoSelfieDenganKTP == null
? new Image.asset('assets/images/camera-icon.png',
key: Key('cameraIconFSKTP'))
: Image.file(File(_imageFileFotoSelfieDenganKTP.path))),
? (getFotoSelfieKtp == null ? new Image.asset('assets/images/camera-icon.png',
key: Key('cameraIconFSKTP'))
: Image.network(getFotoSelfieKtp))
: Image.file(File(_imageFileFotoSelfieDenganKTP.path))
)
),
strokeWidth: 1.0,
dashPattern: [8, 10],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment