Fakultas Ilmu Komputer UI

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

pulling from PBI 15

parents c4e0c5a7 aec21a99
......@@ -704,7 +704,7 @@
"languageVersion": "2.7"
}
],
"generated": "2021-06-10T15:29:29.654837Z",
"generated": "2021-06-10T15:39:52.004139Z",
"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-10 22:29:30.347434","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:39:52.600969","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-06-10 22:29:29.580077.
# Generated by pub on 2021-06-10 22:39:51.951210.
_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.
<<<<<<< HEAD
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_ROOT=C:\flutter\flutter
FLUTTER_APPLICATION_PATH=E:\Fasilkom\Semester 6\Proyek Perangkat Lunak\biodata2\ppl2021-d-slhape
FLUTTER_TARGET=lib\main.dart
>>>>>>> aec21a9964e4c1cd3acf319fb5854abd153112cb
FLUTTER_BUILD_DIR=build
SYMROOT=${SOURCE_ROOT}/../build/ios
FLUTTER_BUILD_NAME=1.0.0
......
#!/bin/sh
# This is a generated file; do not edit or check into version control.
<<<<<<< HEAD
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_ROOT=C:\flutter\flutter"
export "FLUTTER_APPLICATION_PATH=E:\Fasilkom\Semester 6\Proyek Perangkat Lunak\biodata2\ppl2021-d-slhape"
export "FLUTTER_TARGET=lib\main.dart"
>>>>>>> aec21a9964e4c1cd3acf319fb5854abd153112cb
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "FLUTTER_BUILD_NAME=1.0.0"
......
......@@ -96,6 +96,10 @@ class Api {
{'name': name, 'address_id': addressId, 'phone': phone}));
if (apiResult.statusCode == 200) {
print('Patch member berhasil');
print("nama : $name");
print("addressId : $addressId");
print("phone : $phone");
print(apiResult.statusCode);
print(apiResult.body);
} else {
......@@ -117,7 +121,8 @@ class Api {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({'attribute_name': 'gender', 'attribute_value': gen}));
body:
jsonEncode({'attribute_name': 'gender', 'attribute_value': gen}));
if (apiResult.statusCode == 200) {
print('gender berhasil');
print(apiResult.statusCode);
......@@ -135,22 +140,23 @@ class Api {
print(apiResult.body);
throw Exception('Gagal menyimpan gender');
}
}
}
// ======= put member-attribute =======
else {
var apiURL =
Uri.parse('https://canary.fundex.id/api/v1.1/member-attributes/:$id');
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': 'gender', 'attribute_value': gen}));
body:
jsonEncode({'attribute_name': 'gender', 'attribute_value': gen}));
if (apiResult.statusCode == 200) {
print('gender berhasil');
print(apiResult.statusCode);
print(apiResult.body);
print(apiResult.body);
} else {
print('put gender ' + apiResult.statusCode.toString());
print(apiResult.reasonPhrase);
......@@ -160,7 +166,7 @@ class Api {
}
}
}
Future getSpecificMemberAttribute(String attributeName) async {
var apiURL = Uri.parse(
'https://canary.fundex.id/api/v1.1/member-attribute?attribute_name=$attributeName');
......@@ -211,9 +217,10 @@ class Api {
}
Future birthdate(String date, int id) async {
if (await secureStorage.readSecureData('idMemberAttributeBirthdate') == null) {
if (await secureStorage.readSecureData('idMemberAttributeBirthdate') ==
null) {
var apiURL =
Uri.parse('https://canary.fundex.id/api/v1.1/member-attribute');
Uri.parse('https://canary.fundex.id/api/v1.1/member-attribute');
var token = await secureStorage.readSecureData('accessToken');
final apiResult = await client.post(apiURL,
headers: <String, String>{
......@@ -238,10 +245,10 @@ class Api {
print(apiResult.request);
print(apiResult.body);
throw Exception('Gagal menyimpan..');
}
}
} else {
var apiURL =
Uri.parse('https://canary.fundex.id/api/v1.1/member-attributes/:$id');
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>{
......@@ -266,9 +273,10 @@ class Api {
}
Future birthplace(String nameCity, int id) async {
if (await secureStorage.readSecureData('idMemberAttributeBirthplace') == null) {
if (await secureStorage.readSecureData('idMemberAttributeBirthplace') ==
null) {
var apiURL =
Uri.parse('https://canary.fundex.id/api/v1.1/member-attribute');
Uri.parse('https://canary.fundex.id/api/v1.1/member-attribute');
var token = await secureStorage.readSecureData('accessToken');
final apiResult = await client.post(apiURL,
headers: <String, String>{
......@@ -286,7 +294,8 @@ class Api {
var idMemberAttributeBirthplace = jsonData['id'];
await secureStorage.writeSecureData(
'idMemberAttributeBirthplace', idMemberAttributeBirthplace);
print(await secureStorage.readSecureData('idMemberAttributeBirthplace'));
print(
await secureStorage.readSecureData('idMemberAttributeBirthplace'));
} else {
print('put birthplace ' + apiResult.statusCode.toString());
print(apiResult.reasonPhrase);
......@@ -296,7 +305,7 @@ class Api {
}
} else {
var apiURL =
Uri.parse('https://canary.fundex.id/api/v1.1/member-attributes/:$id');
Uri.parse('https://canary.fundex.id/api/v1.1/member-attributes/:$id');
var token = await secureStorage.readSecureData('accessToken');
final apiResult = await client.post(apiURL,
headers: <String, String>{
......@@ -444,6 +453,59 @@ class Api {
}
}
Future getAddress() async {
final apiURL = Uri.parse('https://canary.fundex.id/api/v1.1/address');
var token = await secureStorage.readSecureData('accessToken');
var headers = {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
};
var apiResult = await client.get(apiURL, headers: headers);
print(await secureStorage.readSecureData('accessToken'));
print(apiResult.reasonPhrase);
print(apiResult.request);
print("get address: " + (apiResult.statusCode).toString());
if (apiResult.statusCode == 200) {
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var jsonAddress = (jsonData as Map<String, dynamic>)['address'];
print(apiResult.reasonPhrase);
print(apiResult.request);
print(jsonAddress);
return jsonAddress;
} else {
throw Exception('Get Failed');
}
}
Future putAddress(
id, String addr, String distr, String city, String prov, String zip
) async {
final apiURL =
Uri.parse('https://canary.fundex.id/api/v1.1/address/:$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(
{
"address": addr,
"district": distr,
"city": city,
"province": prov,
"country": "INDONESIA",
"zip_code": zip
}));
print("PUT address: " +
(apiResult.statusCode).toString());
print(apiResult.reasonPhrase);
print(apiResult.request);
print(apiResult.body);
}
Future postAddress(String address, String district, String city,
String province, String zipCode) async {
var apiURL = Uri.parse('https://canary.fundex.id/api/v1.1/address');
......@@ -464,8 +526,8 @@ 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);
print('Patch member berhasil');
await secureStorage.writeSecureData('id_postAddress', id.toString());
print('post address');
print(apiResult.statusCode);
print(apiResult.reasonPhrase);
print(apiResult.request);
......@@ -563,7 +625,7 @@ class Api {
body: jsonEncode(
{'attribute_name': 'enable_domicile', 'attribute_value': 'Yes'}));
if (apiResult.statusCode == 200) {
print('gender berhasil');
print('enable domicile berhasil');
print(apiResult.statusCode);
print(apiResult.body);
// var jsonObject = json.decode(apiResult.body);
......@@ -573,7 +635,7 @@ class Api {
// 'idMemberAttributeGender', idMemberAttributeGender.toString());
print(await secureStorage.readSecureData('idMemberAttributeGender'));
} else {
print('gender ' + apiResult.statusCode.toString());
print('enable domicile ' + apiResult.statusCode.toString());
print(apiResult.reasonPhrase);
print(apiResult.request);
print(apiResult.body);
......@@ -595,11 +657,15 @@ class Api {
body: jsonEncode(
{'attribute_name': 'domicile_address_id', 'attribute_value': id}));
if (apiResult.statusCode == 200) {
print('gender berhasil');
var jsonObject = json.decode(apiResult.body);
var data = (jsonObject as Map<String, dynamic>)['data'];
var id = data['id'];
await secureStorage.writeSecureData('id_domicileAddressId', id.toString());
print('domicile address berhasil');
print(apiResult.statusCode);
print(apiResult.body);
} else {
print('gender ' + apiResult.statusCode.toString());
print('domicile address ' + apiResult.statusCode.toString());
print(apiResult.reasonPhrase);
print(apiResult.request);
print(apiResult.body);
......
This diff is collapsed.
......@@ -19,7 +19,6 @@ class ValidasiTanggal {
}
}
String kota;
class ValidasiTempat {
static String validate(String value) {
return value.isEmpty ? 'Tempat lahir harus di isi' : null;
......@@ -59,6 +58,7 @@ class BiodataBody extends StatefulWidget {
class _BiodataBodyState extends State<BiodataBody> {
// ignore: unused_field
String _namaLengkap;
String kota;
// ignore: unused_field
String _email;
// ignore: unused_field
......@@ -69,24 +69,27 @@ class _BiodataBodyState extends State<BiodataBody> {
String _selectedCity;
final GlobalKey<FormState> _formkey = GlobalKey<FormState>();
final TextEditingController _typeAheadController = TextEditingController();
TextEditingController _typeAheadController = TextEditingController();
TextEditingController _textEditingController = TextEditingController();
TextEditingController _formNamaLengkap = TextEditingController();
TextEditingController _formPhone = TextEditingController(text: "+62-");
// TextEditingController _textController = TextEditingController();
int id;
String email;
String name;
int addressId;
String phone;
List<String> city;
int idGender;
String valGender;
int idbirthplace;
String valbirthplace;
int idbirthdate;
String valbirthdate;
double opacityRadio = 0;
int idKYC;
bool alreadyFilledSection = false;
DateTime date;
String strDate;
double opacityRadio = 0;
void initState() {
super.initState();
selectedRadio = 0;
......@@ -117,24 +120,43 @@ class _BiodataBodyState extends State<BiodataBody> {
final List<String> jsonCity = await Api().getRefCity();
final List<dynamic> jsonMemberAttribute = await Api().getMemberAttribute();
for (var i = 0; i < jsonMemberAttribute.length; i++) {
if (jsonMemberAttribute[i]['attribute_name'] == 'gender') {
idGender = jsonMemberAttribute[i]['id'];
valGender = jsonMemberAttribute[i]['attribute_value'];
if (valGender == "male") {
print("already filled this section before. Male");
validateRadioButton(1);
} else {
validateRadioButton(2);
}
} else if (jsonMemberAttribute[i]['attribute_name'] == 'birthdate') {
idbirthdate = jsonMemberAttribute[i]['id'];
valbirthdate = jsonMemberAttribute[i]['attribute_value'];
strDate = jsonMemberAttribute[i]['attribute_value'];
print("already filled this section before. birthdate = $strDate");
} else if (jsonMemberAttribute[i]['attribute_name'] == 'birthplace') {
idbirthplace= jsonMemberAttribute[i]['id'];
valbirthplace= jsonMemberAttribute[i]['attribute_value'];
idbirthplace = jsonMemberAttribute[i]['id'];
kota = jsonMemberAttribute[i]['attribute_value'];
print("already filled this section before. birthplace = $kota");
} 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(",")[0];
var value = step1.substring(8);
if (value == "true") {
setState(() {
alreadyFilledSection = true;
});
}
}
}
print("json : $json");
id = json['id'];
email = json['email'];
addressId = json['address_id'];
name = json['name'];
var name = json['name'];
phone = json['phone'];
city = jsonCity;
......@@ -142,16 +164,22 @@ class _BiodataBodyState extends State<BiodataBody> {
setState(() {
this.id = id;
this.email = email;
this.name = name;
this._namaLengkap = name;
this.addressId = addressId;
this.phone = phone;
this.city = city;
this.idGender = idGender;
this.valGender = valGender;
this.idbirthdate = idbirthdate;
this.valbirthdate = valbirthdate;
this.idbirthplace = idbirthplace;
this.valbirthplace = valbirthplace;
this.strDate = strDate;
this.kota = kota;
if (alreadyFilledSection) {
_typeAheadController.text = kota;
_textEditingController.text = strDate;
_formPhone.text = phone;
_formNamaLengkap.text = name;
}
});
}
......@@ -168,9 +196,6 @@ class _BiodataBodyState extends State<BiodataBody> {
});
}
DateTime date;
String strDate;
Future<void> _selectDate(BuildContext context) async {
final now = DateTime.now();
final DateTime picked = await showDatePicker(
......@@ -206,11 +231,9 @@ class _BiodataBodyState extends State<BiodataBody> {
color: primary,
),
onPressed: () {
Navigator.push(context,
MaterialPageRoute(
builder: (context) {
return HomeKYCUnregistered();
}));
Navigator.push(context, MaterialPageRoute(builder: (context) {
return HomeKYCUnregistered();
}));
},
),
Text(
......@@ -460,6 +483,8 @@ class _BiodataBodyState extends State<BiodataBody> {
EdgeInsets.fromLTRB(0, 4, 0, 0),
child: TextFormField(
key: Key('nama'),
controller: _formNamaLengkap,
keyboardType: TextInputType.text,
// controller: _textController,
decoration: formInputDecoration(),
......@@ -562,6 +587,7 @@ class _BiodataBodyState extends State<BiodataBody> {
width: 343,
child: TypeAheadFormField(
key: Key('typeahead'),
textFieldConfiguration:
TextFieldConfiguration(
controller: this._typeAheadController,
......@@ -582,11 +608,11 @@ class _BiodataBodyState extends State<BiodataBody> {
onSuggestionSelected: (suggestion) {
this._typeAheadController.text =
suggestion;
this.kota = suggestion;
},
// ignore: missing_return
validator: ValidasiTempat.validate,
onSaved: (value) =>
kota = value,
// onSaved: (value) => this.kota = value,
),
),
......@@ -703,11 +729,12 @@ class _BiodataBodyState extends State<BiodataBody> {
EdgeInsets.fromLTRB(0, 4, 0, 0),
child: TextFormField(
key: Key('nomor'),
controller: _formPhone,
keyboardType: TextInputType.phone,
decoration: formInputDecoration(),
validator: ValidasiNomor.validate,
onSaved: (String nomor) {
_nomorHandphone = nomor;
onChanged: (String nomor) {
phone = nomor;
},
),
),
......@@ -742,17 +769,31 @@ class _BiodataBodyState extends State<BiodataBody> {
return;
}
Api().patchMember(_namaLengkap,
addressId, _nomorHandphone);
Api().patchMember(
_namaLengkap, addressId, phone);
// print(_namaLengkap + addressId.toString() +_nomorHandphone);
Api().gender(jenisKelamin, idGender);
// print(jenisKelamin);
Api().birthplace(kota, idbirthplace);
print(kota);
Api().birthdate(strDate,idbirthdate);
print(strDate);
Api().kyc_progress(true, false, false, false, false);
if (alreadyFilledSection == true) {
print(
"button Selanjutnya masuk PUTMEMBER");
Api().putMemberAttribute(
idGender, 'gender', jenisKelamin);
Api().putMemberAttribute(idbirthdate,
'birthdate', strDate);
Api().putMemberAttribute(
idbirthplace, 'birthplace', kota);
} else {
print(
"button Selanjutnya masuk POST");
Api().gender(jenisKelamin, idGender);
// print(jenisKelamin);
Api().birthplace(kota, idbirthplace);
print(kota);
Api().birthdate(strDate, idbirthdate);
print(strDate);
// Api().kyc_progress(
// true, false, false, false, false);
}
Navigator.push(context,
MaterialPageRoute(
......
......@@ -770,8 +770,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().put_kyc_progress(idKYC, true,
// true, true, false, false);
}
Navigator.push(context,
......
import 'package:flutter/material.dart';
import 'package:flutter_typeahead/flutter_typeahead.dart';
import 'package:fundex_app/api/api.dart';
import 'package:fundex_app/assets/colors.dart';
import 'package:fundex_app/main-screen.dart';
import 'package:fundex_app/pages/kyc/data_identitas.dart';
......@@ -35,7 +36,7 @@ var latarBelakang;
class ValidasiTempat {
static String validate(String value) {
return value.isEmpty ? 'Harus diisi' : latarBelakang = value;
return value.isEmpty ? 'Harus diisi' : null;
}
}
......@@ -52,7 +53,13 @@ class PekerjaanList {
class _DataPendukungState extends State<DataPendukung> {
final GlobalKey<FormState> _formkey = GlobalKey<FormState>();
final TextEditingController _typeAheadController = TextEditingController();
TextEditingController _typeAheadController = TextEditingController();
TextEditingController _formNamaPerusahaan = TextEditingController();
TextEditingController _formBidangUsaha = TextEditingController();
TextEditingController _formAlamatKantor = TextEditingController();
TextEditingController _formJabatan = TextEditingController();
TextEditingController _formNoTeleponKantor = TextEditingController();
TextEditingController _formEmailKantor = TextEditingController();
// ignore: unused_field
String _latarBelakang;
......@@ -74,6 +81,148 @@ class _DataPendukungState extends State<DataPendukung> {
String _tujuanInvestasi;
bool _checkBox = false;
var _onPressed;
int selectedRadio;
int idKYC;
bool alreadyFilledSection = false;
int getIdEducation;
int getIdIncomeSource;
int getIdOccupation;
int getIdMotivation;
String getEducation;
String getIncomeSource;
String getOccupation;
String getMotivation;
int getIdOrganizationName;
int getIdOrganizationField;
String getOrganizationName;
String getOrganizationField;
int getIdPosition;
int getIdOrganizationPhone;
String getPosition;
String getOrganizationPhone;
int getIdOrganizationEmail;
int getIdOrganizationAddr;
String getOrganizationEmail;
String getOrganizationaddr;
void initState(){
super.initState();
selectedRadio = 0;
init();
}
Future init() async {
final List<dynamic> jsonMemberAttribute = await Api().getMemberAttribute();
for (var i = 0; i < jsonMemberAttribute.length; i++) {
if (jsonMemberAttribute[i]['attribute_name'] == 'education') {
getIdEducation = jsonMemberAttribute[i]['id'];
getEducation = jsonMemberAttribute[i]['attribute_value'];
} else if (jsonMemberAttribute[i]['attribute_name'] == 'income_source') {
getIdIncomeSource = jsonMemberAttribute[i]['id'];
getIncomeSource = jsonMemberAttribute[i]['attribute_value'];
} else if (jsonMemberAttribute[i]['attribute_name'] == 'occupation') {
getIdOccupation = jsonMemberAttribute[i]['id'];
getOccupation = jsonMemberAttribute[i]['attribute_value'];
print("already filled this section before. $getOccupation");
if (getOccupation == 'Lainnya') {
print("already filled this section before. Male");
</