Fakultas Ilmu Komputer UI

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

pulling from staging

parents 26ec156a 91daa656
......@@ -704,7 +704,7 @@
"languageVersion": "2.7"
}
],
"generated": "2021-05-31T06:37:12.286215Z",
"generated": "2021-06-10T15:29:29.654837Z",
"generator": "pub",
"generatorVersion": "2.13.0"
}
{"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-04 22:02:30.358948","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-10 22:29:30.347434","version":"2.1.0-12.1.pre"}
\ No newline at end of file
......@@ -3,7 +3,7 @@
#
# For more info see: https://dart.dev/go/dot-packages-deprecation
#
# Generated by pub on 2021-05-31 13:37:12.262281.
# Generated by pub on 2021-06-10 22:29:29.580077.
_fe_analyzer_shared:file:///D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/_fe_analyzer_shared-14.0.0/lib/
analyzer:file:///D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-0.41.2/lib/
args:file:///D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/args-2.0.0/lib/
......
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=C:\flutter\flutter
FLUTTER_APPLICATION_PATH=E:\Fasilkom\Semester 6\Proyek Perangkat Lunak\data-pendukung\ppl2021-d-slhape
FLUTTER_TARGET=lib\main.dart
FLUTTER_ROOT=/Users/ferdisungkar/flutter
FLUTTER_APPLICATION_PATH=/Users/ferdisungkar/Desktop/Files/Universitas-Indonesia/Semester-6/PPL/Project/ppl2021-d-slhape
FLUTTER_TARGET=/Users/ferdisungkar/Desktop/Files/Universitas-Indonesia/Semester-6/PPL/Project/ppl2021-d-slhape/lib/main.dart
FLUTTER_BUILD_DIR=build
SYMROOT=${SOURCE_ROOT}/../build\ios
SYMROOT=${SOURCE_ROOT}/../build/ios
FLUTTER_BUILD_NAME=1.0.0
FLUTTER_BUILD_NUMBER=1
DART_DEFINES=flutter.inspector.structuredErrors%3Dtrue
DART_OBFUSCATION=false
TRACK_WIDGET_CREATION=false
TRACK_WIDGET_CREATION=true
TREE_SHAKE_ICONS=false
PACKAGE_CONFIG=.packages
PACKAGE_CONFIG=/Users/ferdisungkar/Desktop/Files/Universitas-Indonesia/Semester-6/PPL/Project/ppl2021-d-slhape/.dart_tool/package_config.json
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=C:\flutter\flutter"
export "FLUTTER_APPLICATION_PATH=E:\Fasilkom\Semester 6\Proyek Perangkat Lunak\data-pendukung\ppl2021-d-slhape"
export "FLUTTER_TARGET=lib\main.dart"
export "FLUTTER_ROOT=/Users/ferdisungkar/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/ferdisungkar/Desktop/Files/Universitas-Indonesia/Semester-6/PPL/Project/ppl2021-d-slhape"
export "FLUTTER_TARGET=/Users/ferdisungkar/Desktop/Files/Universitas-Indonesia/Semester-6/PPL/Project/ppl2021-d-slhape/lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build\ios"
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_DEFINES=flutter.inspector.structuredErrors%3Dtrue"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.packages"
export "PACKAGE_CONFIG=/Users/ferdisungkar/Desktop/Files/Universitas-Indonesia/Semester-6/PPL/Project/ppl2021-d-slhape/.dart_tool/package_config.json"
......@@ -161,6 +161,33 @@ class Api {
}
}
Future getSpecificMemberAttribute(String attributeName) async {
var apiURL = Uri.parse(
'https://canary.fundex.id/api/v1.1/member-attribute?attribute_name=$attributeName');
var token = await secureStorage.readSecureData('accessToken');
final apiResult = await client.get(apiURL, headers: <String, String>{
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
});
if (apiResult.statusCode == 200) {
print('GET member attribute $attributeName succeeded : ' +
apiResult.statusCode.toString());
print(apiResult.reasonPhrase);
print(apiResult.request);
print(apiResult.body);
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
return jsonData;
} else {
print('GET member attribute $attributeName failed : ' +
apiResult.statusCode.toString());
print(apiResult.reasonPhrase);
print(apiResult.request);
print(apiResult.body);
throw Exception('Gagal menyimpan..');
}
}
Future getMemberAttribute() async {
final apiURL = Uri.parse('https://canary.fundex.id/api/v1.1/member-attributes?attribute_name=&offset=&limit=&order_by=');
var token = await secureStorage.readSecureData('accessToken');
......@@ -316,6 +343,26 @@ class Api {
}
}
Future putMemberAttribute(id, String attributeName, String value) async {
final apiURL =
Uri.parse('https://canary.fundex.id/api/v1.1/member-attributes/$id');
var token = await secureStorage.readSecureData('accessToken');
var headers = {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
};
var apiResult = await client.put(apiURL,
headers: headers,
body: jsonEncode(
{"attribute_name": attributeName, "attribute_value": value}));
print("PUT member-attribute $attributeName: " +
(apiResult.statusCode).toString());
print("value : $value");
print(apiResult.reasonPhrase);
print(apiResult.request);
print(apiResult.body);
}
Future getRefCity() async {
final apiURL = Uri.parse(
'https://canary.fundex.id/api/v1.1/ref-cities?offset=&limit=');
......@@ -417,8 +464,7 @@ class Api {
var jsonObject = json.decode(apiResult.body);
var data = (jsonObject as Map<String, dynamic>)['data'];
var id = data['id'];
await secureStorage.writeSecureData(
'id_postAddress', id);
await secureStorage.writeSecureData('id_postAddress', id);
print('Patch member berhasil');
print(apiResult.statusCode);
print(apiResult.reasonPhrase);
......@@ -435,11 +481,8 @@ class Api {
}
// ignore: non_constant_identifier_names
Future kyc_progress(bool step1,
bool step2,
bool step3,
bool step4,
bool step5) async {
Future kyc_progress(
bool step1, bool step2, bool step3, bool step4, bool step5) async {
var apiURL =
Uri.parse('https://canary.fundex.id/api/v1.1/member-attribute');
var token = await secureStorage.readSecureData('accessToken');
......@@ -449,12 +492,10 @@ class Api {
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({
'attribute_name': 'kyc_progress',
'attribute_value': {"step1":step1,
"step2":step2,
"step3":step3,
"step4":step4,
"step5":step5}}));
'attribute_name': 'kyc_progress',
'attribute_value':
"{\"step1\":$step1,\"step2\":$step2,\"step3\":$step3,\"step4\":$step4,\"step5\":$step5}"
}));
if (apiResult.statusCode == 200) {
print('kyc_progress berhasil');
print(apiResult.statusCode);
......@@ -474,6 +515,41 @@ class Api {
}
}
// ignore: non_constant_identifier_names
Future put_kyc_progress(int id, bool step1, bool step2, bool step3,
bool step4, bool step5) async {
var apiURL =
Uri.parse('https://canary.fundex.id/api/v1.1/member-attributes/$id');
var token = await secureStorage.readSecureData('accessToken');
final apiResult = await client.put(apiURL,
headers: <String, String>{
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({
'attribute_name': 'kyc_progress',
'attribute_value':
"{\"step1\":$step1,\"step2\":$step2,\"step3\":$step3,\"step4\":$step4,\"step5\":$step5}"
}));
if (apiResult.statusCode == 200) {
print('put_kyc_progress berhasil');
print(apiResult.statusCode);
print(apiResult.body);
// var jsonObject = json.decode(apiResult.body);
// var jsonData = (jsonObject as Map<String, dynamic>)['data'];
// var idMemberAttributeGender = jsonData['id'];
// await secureStorage.writeSecureData(
// 'idMemberAttributeGender', idMemberAttributeGender.toString());
// print(await secureStorage.readSecureData('idMemberAttributeGender'));
} else {
print('kyc_progress ' + apiResult.statusCode.toString());
print(apiResult.reasonPhrase);
print(apiResult.request);
print(apiResult.body);
throw Exception('Gagal menyimpan gender');
}
}
// ignore: non_constant_identifier_names
Future enable_domicile() async {
var apiURL =
......@@ -484,7 +560,8 @@ class Api {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({'attribute_name': 'enable_domicile', 'attribute_value': 'Yes'}));
body: jsonEncode(
{'attribute_name': 'enable_domicile', 'attribute_value': 'Yes'}));
if (apiResult.statusCode == 200) {
print('gender berhasil');
print(apiResult.statusCode);
......@@ -515,7 +592,8 @@ class Api {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({'attribute_name': 'domicile_address_id', 'attribute_value': id}));
body: jsonEncode(
{'attribute_name': 'domicile_address_id', 'attribute_value': id}));
if (apiResult.statusCode == 200) {
print('gender berhasil');
print(apiResult.statusCode);
......@@ -539,7 +617,8 @@ class Api {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({'attribute_name': 'marriage_status', 'attribute_value': val}));
body: jsonEncode(
{'attribute_name': 'marriage_status', 'attribute_value': val}));
if (apiResult.statusCode == 200) {
print('marriage_status berhasil');
print(apiResult.statusCode);
......@@ -563,17 +642,18 @@ class Api {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({'attribute_name': 'spouse_name', 'attribute_value': val}));
body: jsonEncode(
{'attribute_name': 'spouse_name', 'attribute_value': val}));
if (apiResult.statusCode == 200) {
print('marriage_status berhasil');
print('nama pasangan berhasil');
print(apiResult.statusCode);
print(apiResult.body);
} else {
print('gender ' + apiResult.statusCode.toString());
print('nama pasangan failed : ' + apiResult.statusCode.toString());
print(apiResult.reasonPhrase);
print(apiResult.request);
print(apiResult.body);
throw Exception('Gagal menyimpan gender');
throw Exception('Gagal menyimpan nama pasangan');
}
}
......@@ -587,7 +667,10 @@ class Api {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({'attribute_name': 'biological_mother_name', 'attribute_value': val}));
body: jsonEncode({
'attribute_name': 'biological_mother_name',
'attribute_value': val
}));
if (apiResult.statusCode == 200) {
print('marriage_status berhasil');
print(apiResult.statusCode);
......@@ -611,7 +694,8 @@ class Api {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({'attribute_name': 'heir_name', 'attribute_value': val}));
body: jsonEncode(
{'attribute_name': 'heir_name', 'attribute_value': val}));
if (apiResult.statusCode == 200) {
print('marriage_status berhasil');
print(apiResult.statusCode);
......@@ -635,7 +719,8 @@ class Api {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({'attribute_name': 'heir_relation', 'attribute_value': val}));
body: jsonEncode(
{'attribute_name': 'heir_relation', 'attribute_value': val}));
if (apiResult.statusCode == 200) {
print('marriage_status berhasil');
print(apiResult.statusCode);
......@@ -659,7 +744,8 @@ class Api {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({'attribute_name': 'heir_phone', 'attribute_value': val}));
body: jsonEncode(
{'attribute_name': 'heir_phone', 'attribute_value': val}));
if (apiResult.statusCode == 200) {
print('marriage_status berhasil');
print(apiResult.statusCode);
......@@ -683,7 +769,8 @@ class Api {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({'attribute_name': 'heir_address', 'attribute_value': val}));
body: jsonEncode(
{'attribute_name': 'heir_address', 'attribute_value': val}));
if (apiResult.statusCode == 200) {
print('marriage_status berhasil');
print(apiResult.statusCode);
......@@ -707,7 +794,8 @@ class Api {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({'attribute_name': 'identity_number', 'attribute_value': val}));
body: jsonEncode(
{'attribute_name': 'identity_number', 'attribute_value': val}));
if (apiResult.statusCode == 200) {
print('marriage_status berhasil');
print(apiResult.statusCode);
......@@ -731,7 +819,8 @@ class Api {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({'attribute_name': 'npwp_number', 'attribute_value': val}));
body: jsonEncode(
{'attribute_name': 'npwp_number', 'attribute_value': val}));
if (apiResult.statusCode == 200) {
print('marriage_status berhasil');
print(apiResult.statusCode);
......@@ -755,7 +844,8 @@ class Api {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({'attribute_name': 'education', 'attribute_value': val}));
body: jsonEncode(
{'attribute_name': 'education', 'attribute_value': val}));
if (apiResult.statusCode == 200) {
print('marriage_status berhasil');
print(apiResult.statusCode);
......@@ -779,7 +869,8 @@ class Api {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({'attribute_name': 'income_source', 'attribute_value': val}));
body: jsonEncode(
{'attribute_name': 'income_source', 'attribute_value': val}));
if (apiResult.statusCode == 200) {
print('marriage_status berhasil');
print(apiResult.statusCode);
......@@ -803,7 +894,8 @@ class Api {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({'attribute_name': 'yearly_income', 'attribute_value': val}));
body: jsonEncode(
{'attribute_name': 'yearly_income', 'attribute_value': val}));
if (apiResult.statusCode == 200) {
print('marriage_status berhasil');
print(apiResult.statusCode);
......@@ -827,7 +919,8 @@ class Api {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({'attribute_name': 'occupation', 'attribute_value': val}));
body: jsonEncode(
{'attribute_name': 'occupation', 'attribute_value': val}));
if (apiResult.statusCode == 200) {
print('marriage_status berhasil');
print(apiResult.statusCode);
......@@ -851,7 +944,8 @@ class Api {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({'attribute_name': 'organization_name', 'attribute_value': val}));
body: jsonEncode(
{'attribute_name': 'organization_name', 'attribute_value': val}));
if (apiResult.statusCode == 200) {
print('marriage_status berhasil');
print(apiResult.statusCode);
......@@ -875,7 +969,8 @@ class Api {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({'attribute_name': 'organization_field', 'attribute_value': val}));
body: jsonEncode(
{'attribute_name': 'organization_field', 'attribute_value': val}));
if (apiResult.statusCode == 200) {
print('marriage_status berhasil');
print(apiResult.statusCode);
......@@ -899,7 +994,10 @@ class Api {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({'attribute_name': 'organization_address', 'attribute_value': val}));
body: jsonEncode({
'attribute_name': 'organization_address',
'attribute_value': val
}));
if (apiResult.statusCode == 200) {
print('marriage_status berhasil');
print(apiResult.statusCode);
......@@ -923,7 +1021,8 @@ class Api {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({'attribute_name': 'position', 'attribute_value': val}));
body:
jsonEncode({'attribute_name': 'position', 'attribute_value': val}));
if (apiResult.statusCode == 200) {
print('marriage_status berhasil');
print(apiResult.statusCode);
......@@ -947,7 +1046,8 @@ class Api {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({'attribute_name': 'organization_phone', 'attribute_value': val}));
body: jsonEncode(
{'attribute_name': 'organization_phone', 'attribute_value': val}));
if (apiResult.statusCode == 200) {
print('marriage_status berhasil');
print(apiResult.statusCode);
......@@ -971,7 +1071,8 @@ class Api {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({'attribute_name': 'organization_email', 'attribute_value': val}));
body: jsonEncode(
{'attribute_name': 'organization_email', 'attribute_value': val}));
if (apiResult.statusCode == 200) {
print('marriage_status berhasil');
print(apiResult.statusCode);
......@@ -995,7 +1096,8 @@ class Api {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({'attribute_name': 'motivation', 'attribute_value': val}));
body: jsonEncode(
{'attribute_name': 'motivation', 'attribute_value': val}));
if (apiResult.statusCode == 200) {
print('marriage_status berhasil');
print(apiResult.statusCode);
......
......@@ -18,27 +18,52 @@ class BiodataKeluarga extends StatefulWidget {
class _BiodataKeluargaBodyState extends State<BiodataKeluarga> {
final GlobalKey<FormState> _formkey = GlobalKey<FormState>();
TextEditingController _formNamaGadisIbuKandung = TextEditingController();
TextEditingController _formNamaAhliWaris = TextEditingController();
TextEditingController _formHubunganDenganAhliWaris = TextEditingController();
TextEditingController _formPhoneAhliWaris = TextEditingController();
TextEditingController _formAlamatAhliWaris = TextEditingController();
TextEditingController _formNamaLengkapPasangan = TextEditingController();
// ignore: unused_field
String _nomorHandphone;
String _namaGadisIbu;
// ignore: unused_field
String _alamatAhli;
String _namaAhli;
// ignore: unused_field
String _hubunganAhli;
// ignore: unused_field
String _namaAhli;
String _alamatAhli;
// ignore: unused_field
String _namaGadisIbu;
String _nomorHandphone;
// ignore: unused_field
String _namaPasangan;
// ignore: unused_field
int _iDnamaGadisIbu;
// ignore: unused_field
int _iDnamaAhli;
// ignore: unused_field
int _iDhubunganAhli;
// ignore: unused_field
int _iDalamatAhli;
// ignore: unused_field
int _iDnomorHandphone;
// ignore: unused_field
int _iDnamaPasangan;
// ignore: unused_field
int _iDstatusPernikahan;
int idKYC;
int selectedRadio;
String statusPernikahan;
double opacityRadio = 0;
bool alreadyFilledSection = false;
void initState() {
super.initState();
selectedRadio = 0;
init();
}
void validateRadioButton(value) {
validateRadioButton(value) {
selectedRadio = value;
if (selectedRadio == 0) {
setState(() {
......@@ -46,25 +71,97 @@ class _BiodataKeluargaBodyState extends State<BiodataKeluarga> {
});
} else if (selectedRadio == 1) {
setState(() {
statusPernikahan = 'Single';
statusPernikahan = 'single';
opacityRadio = 0;
});
} else if (selectedRadio == 2) {
getNamaPasangan();
setState(() {
statusPernikahan = 'Married';
statusPernikahan = 'married';
opacityRadio = 0;
});
} else {
setState(() {
statusPernikahan = 'Divorce';
statusPernikahan = 'widow';
opacityRadio = 0;
});
}
}
setSelectedRadio(int val) {
Future getNamaPasangan() async {
var data = await Api().getSpecificMemberAttribute("spouse_name");
_iDnamaPasangan = data['id'];
_namaPasangan = data['attribute_value'];
_formNamaLengkapPasangan.text = _namaPasangan;
print("status pernikahan : married, spouse_name = $_namaPasangan");
}
Future init() async {
final List<dynamic> jsonMemberAttribute = await Api().getMemberAttribute();
for (var i = 0; i < jsonMemberAttribute.length; i++) {
if (jsonMemberAttribute[i]['attribute_name'] ==
'biological_mother_name') {
_iDnamaGadisIbu = jsonMemberAttribute[i]['id'];
_namaGadisIbu = jsonMemberAttribute[i]['attribute_value'];
print(
"already filled this section before. nama gadis ibu = $_namaGadisIbu");
} else if (jsonMemberAttribute[i]['attribute_name'] ==
'marriage_status') {
_iDstatusPernikahan = jsonMemberAttribute[i]['id'];
statusPernikahan = jsonMemberAttribute[i]['attribute_value'];
print("status pernikahan: $statusPernikahan");
if (statusPernikahan == "married") {
validateRadioButton(2);
} else if (statusPernikahan == "widow") {
print("status pernikahan : widow");
validateRadioButton(3);
} else if (statusPernikahan == "single") {
print("status pernikahan : single");
validateRadioButton(1);
}
} else if (jsonMemberAttribute[i]['attribute_name'] == 'kyc_progress') {
var map = (jsonMemberAttribute[i] as Map<String, dynamic>);
idKYC = map['id'];
var val = map['attribute_value'];
var str = val.substring(1, val.length - 1);
var step1 = str.split(",")[2];
var value = step1.substring(8);
if (value == "true") {
setState(() {
alreadyFilledSection = true;
});
}
} else if (jsonMemberAttribute[i]['attribute_name'] == 'heir_name') {
_iDnamaAhli = jsonMemberAttribute[i]['id'];
_namaAhli = jsonMemberAttribute[i]['attribute_value'];
print(
"already filled this section before. nama ahli waris = $_namaAhli");
} else if (jsonMemberAttribute[i]['attribute_name'] == 'heir_relation') {
_iDhubunganAhli = jsonMemberAttribute[i]['id'];
_hubunganAhli = jsonMemberAttribute[i]['attribute_value'];
print(
"already filled this section before. hubungan dengan ahli waris = $_hubunganAhli");
} else if (jsonMemberAttribute[i]['attribute_name'] == 'heir_phone') {
_iDnomorHandphone = jsonMemberAttribute[i]['id'];
_nomorHandphone = jsonMemberAttribute[i]['attribute_value'];
print(
"already filled this section before. no handphone ahli waris = $_nomorHandphone");
} else if (jsonMemberAttribute[i]['attribute_name'] == 'heir_address') {
_iDalamatAhli = jsonMemberAttribute[i]['id'];
_alamatAhli = jsonMemberAttribute[i]['attribute_value'];
print(
"already filled this section before. alamat ahli waris = $_alamatAhli");
}
}
setState(() {
selectedRadio = val;
if (alreadyFilledSection) {
_formNamaGadisIbuKandung.text = _namaGadisIbu;
_formNamaAhliWaris.text = _namaAhli;
_formHubunganDenganAhliWaris.text = _hubunganAhli;
_formPhoneAhliWaris.text = _nomorHandphone;
_formAlamatAhliWaris.text = _alamatAhli;
}
});
}
......@@ -389,19 +486,19 @@ class _BiodataKeluargaBodyState extends State<BiodataKeluarga> {
),
])
])),
Container(
margin: EdgeInsets.fromLTRB(10, 0, 0,