Fakultas Ilmu Komputer UI

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

feat: adding icon button, update test, and adding API for foto

parents fc2b8368 0b764942
Pipeline #83314 passed with stages
in 10 minutes and 47 seconds
......@@ -704,7 +704,7 @@
"languageVersion": "2.7"
}
],
"generated": "2021-06-10T15:39:52.004139Z",
"generated": "2021-06-10T16:51:04.037068Z",
"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:39:52.600969","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-25 16:49:57.940427","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:39:51.951210.
# Generated by pub on 2021-06-10 23:51:03.951294.
_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
<<<<<<< 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
......@@ -8,6 +9,16 @@ 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_ROOT=C:\flutter\flutter
FLUTTER_APPLICATION_PATH=E:\Fasilkom\Semester 6\Proyek Perangkat Lunak\biodata2\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
>>>>>>> 91daa656c5e94ce17276f720ff6972311abf7c69
>>>>>>> 0b764942660bfa83f5e9ea7e682f8641f77f4063
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
<<<<<<< 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"
......@@ -9,6 +10,16 @@ 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_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"
=======
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"
>>>>>>> 91daa656c5e94ce17276f720ff6972311abf7c69
>>>>>>> 0b764942660bfa83f5e9ea7e682f8641f77f4063
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "FLUTTER_BUILD_NAME=1.0.0"
......
......@@ -3,6 +3,7 @@ import 'dart:io';
import 'package:fundex_app/pages/business/EquityOfferings.dart';
import 'package:fundex_app/storage/storage.dart';
import 'package:http/http.dart' show Client;
// import 'package:http/http.dart' as http;
class Api {
Client client = Client();
......@@ -1176,6 +1177,81 @@ class Api {
throw Exception('Gagal menyimpan gender');
}
}
Future postFotoMemberAttr(String name, var idFoto) async {
var apiURL =
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>{
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode(
{'attribute_name': name, 'attribute_value': idFoto}));
if (apiResult.statusCode == 200) {
print('marriage_status berhasil');
print(apiResult.statusCode);
print(apiResult.body);
} else {
print('gender ' + apiResult.statusCode.toString());
print(apiResult.reasonPhrase);
print(apiResult.request);
print(apiResult.body);
throw Exception('Gagal menyimpan gender');
}
}
// Future postFotoMemberDoc(String val, String name) async {
// var apiURL =
// Uri.parse('https://canary.fundex.id/api/v1.1/member-document?document_type_id=document_type_id&is_public=true');
// var req = http.MultipartRequest('POST', apiURL);
// var token = await secureStorage.readSecureData('accessToken');
// req.files.add(
// http.MultipartFile(
// 'picture',
// File(val).readAsBytes().asStream(),
// File(val).lengthSync(),
// filename: val.split("/").last
// )
// );
// var response = await req.send();
// if(response.statusCode == 200) {
// var jsonObject = json.decode(req.body);
// var data = (jsonObject as Map<String, dynamic>)['data'];
// var id = data['id'];
// await secureStorage.writeSecureData('id_domicileAddressId', id.toString());
// await secureStorage.writeSecureData(name, id.toString());
// print('Uploaded!');
// }
// }
Future getFotoMemberDoc(int id) async {
var apiURL =
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',
};
var apiResult = await client.get(apiURL, headers: headers);
print(await secureStorage.readSecureData('accessToken'));
print(apiResult.reasonPhrase);
print(apiResult.request);
print("get Foto: " + (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>)['member_document'];
var thumbnail = jsonAddress['thumbnail'];
print(apiResult.reasonPhrase);
print(apiResult.request);
print(jsonAddress);
return thumbnail;
} else {
throw Exception('Get Failed');
}
}
// end API AAN =======================================================================================================
Future forgetPassword(String email, int statusCode) async {
......
......@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:fundex_app/api/api.dart';
import 'package:fundex_app/assets/colors.dart';
import 'package:flutter_typeahead/flutter_typeahead.dart';
import 'package:fundex_app/pages/business/homekycUnregsitered.dart';
import 'package:fundex_app/pages/kyc/biodata_body.dart';
import 'package:fundex_app/pages/kyc/biodata_keluarga_body.dart';
import 'package:fundex_app/pages/kyc/design.dart';
......@@ -268,7 +269,9 @@ class _AlamatBodyState extends State<AlamatBody> {
color: primary,
),
onPressed: () {
Navigator.pop(context);
Navigator.push(context, MaterialPageRoute(builder: (context) {
return HomeKYCUnregistered();
}));
},
),
Text('e-KYC Pemodal', style: titleTextStyle()),
......@@ -301,10 +304,15 @@ class _AlamatBodyState extends State<AlamatBody> {
color: primary,
borderRadius:
BorderRadius.circular(100)),
child: Icon(
Icons.check_outlined,
color: white,
size: 16,
child: IconButton(
icon: Icon(Icons.check_outlined,
color: white,
size: 16),
onPressed: () {
Navigator.push(context, MaterialPageRoute(builder: (context) {
return BiodataBody();
}));
},
),
),
......
import 'package:flutter/material.dart';
import 'package:fundex_app/api/api.dart';
import 'package:fundex_app/assets/colors.dart';
import 'package:fundex_app/pages/business/homekycUnregsitered.dart';
import 'package:fundex_app/pages/kyc/alamat_body.dart';
import 'package:fundex_app/pages/kyc/biodata_body.dart';
import 'package:fundex_app/pages/kyc/data_identitas.dart';
import 'package:fundex_app/pages/kyc/design.dart';
......@@ -179,7 +181,9 @@ class _BiodataKeluargaBodyState extends State<BiodataKeluarga> {
color: primary,
),
onPressed: () {
Navigator.pop(context);
Navigator.push(context, MaterialPageRoute(builder: (context) {
return HomeKYCUnregistered();
}));
}),
Text('e-KYC Pemodal', style: titleTextStyle()),
],
......@@ -213,10 +217,15 @@ class _BiodataKeluargaBodyState extends State<BiodataKeluarga> {
color: primary,
borderRadius:
BorderRadius.circular(100)),
child: Icon(
Icons.check_outlined,
color: white,
size: 16,
child: IconButton(
icon: Icon(Icons.check_outlined,
color: white,
size: 16),
onPressed: () {
Navigator.push(context, MaterialPageRoute(builder: (context) {
return BiodataBody();
}));
},
),
),
......@@ -235,10 +244,15 @@ class _BiodataKeluargaBodyState extends State<BiodataKeluarga> {
color: primary,
borderRadius:
BorderRadius.circular(100)),
child: Icon(
Icons.check_outlined,
color: white,
size: 16,
child: IconButton(
icon: Icon(Icons.check_outlined,
color: white,
size: 16),
onPressed: () {
Navigator.push(context, MaterialPageRoute(builder: (context) {
return AlamatBody();
}));
},
),
),
......
......@@ -417,7 +417,6 @@ class _DataPendukungState extends State<DataPendukung> {
@override
Widget build(BuildContext context) {
// String radioItem;
if (_checkBox == true) {
_onPressed = () {
if (!_formkey.currentState.validate()) {
......@@ -786,19 +785,11 @@ class _DataPendukungState extends State<DataPendukung> {
.map((data) => RadioListTile(
// key: Key('pekerjaan'),
title: Text("${data.name}"),
groupValue: id,
groupValue: selectedRadio,
value: data.index,
onChanged: (val) {
validateRadioButton(data.index);
print(data.index);
// setState(() {
// radioItem = data.name;
// id = data.index;
// selectedRadio = data.index;
// print(radioItem);
// print(id);
// print(selectedRadio);
// });
validateRadioButton(val);
print(val);
},
))
.toList(),
......@@ -937,18 +928,11 @@ class _DataPendukungState extends State<DataPendukung> {
onPrimary: secondary,
),
onPressed: () {
if (!_formkey.currentState
.validate()) {
print("Failed");
}
Navigator.push(context,
MaterialPageRoute(
builder: (context) {
return DataIdentitas();
}));
// _formkey.currentState.save();
// print(_noKTP);
// print(_noPWP);
},
child: Text(
"Sebelumnya",
......
......@@ -4,6 +4,9 @@ import 'package:dotted_border/dotted_border.dart';
import 'package:flutter/material.dart';
import 'package:fundex_app/api/api.dart';
import 'package:fundex_app/assets/colors.dart';
import 'package:fundex_app/pages/business/homekycUnregsitered.dart';
import 'package:fundex_app/pages/kyc/alamat_body.dart';
import 'package:fundex_app/pages/kyc/biodata_body.dart';
import 'package:fundex_app/pages/kyc/biodata_keluarga_body.dart';
import 'package:fundex_app/pages/kyc/biodata_pendukung.dart';
import 'package:fundex_app/pages/kyc/design.dart';
......@@ -27,6 +30,10 @@ class Validasi {
}
}
var getFotoKtp;
var getFotoNpwp;
var getFotoSelfie;
var getFotoSelfieKtp;
class _DataIdentitasState extends State<DataIdentitas> {
final GlobalKey<FormState> _formkey = GlobalKey<FormState>();
TextEditingController _formNomorKTP = TextEditingController();
......@@ -43,6 +50,7 @@ class _DataIdentitasState extends State<DataIdentitas> {
PickedFile _imageFileFotoSelfie;
// ignore: unused_field
PickedFile _imageFileFotoSelfieDenganKTP;
double opacityRadio = 0;
int idKYC;
bool alreadyFilledSection = true;
......@@ -50,7 +58,15 @@ class _DataIdentitasState extends State<DataIdentitas> {
int getIdNoNPWP;
String getNoKTP;
String getNoNPWP;
var getIdFotoKTPMemberAttr;
var getIdFotoKTPMemberDoc;
var getIdFotoNPWPMemberAttr;
var getIdFotoNPWPMemberDoc;
var getIdFotoSelfieMemberAttr;
var getIdFotoSelfieMemberDoc;
var getIdFotoSelfieKtpMemberAttr;
var getIdFotoSelfieKtpMemberDoc;
void initState() {
super.initState();
init();
......@@ -72,6 +88,30 @@ class _DataIdentitasState extends State<DataIdentitas> {
getNoNPWP = jsonMemberAttribute[i]['attribute_value'];
print(
"already filled this section before. nomor npwp = $getNoNPWP");
} else if (jsonMemberAttribute[i]['attribute_name'] ==
'selfie_photo_doc_id') {
getIdFotoSelfieMemberAttr = jsonMemberAttribute[i]['id'];
getIdFotoSelfieMemberDoc = jsonMemberAttribute[i]['attribute_value'];
print(
"already filled this section before. nomor npwp = $getIdFotoSelfieMemberAttr + $getIdFotoSelfieMemberDoc");
} else if (jsonMemberAttribute[i]['attribute_name'] ==
'selfie_additional_doc_id') {
getIdFotoSelfieKtpMemberAttr = jsonMemberAttribute[i]['id'];
getIdFotoSelfieKtpMemberDoc = jsonMemberAttribute[i]['attribute_value'];
print(
"already filled this section before. nomor npwp = $getIdFotoSelfieKtpMemberAttr + $getIdFotoSelfieKtpMemberDoc");
} else if (jsonMemberAttribute[i]['attribute_name'] ==
'npwp_doc_id') {
getIdFotoNPWPMemberAttr = jsonMemberAttribute[i]['id'];
getIdFotoNPWPMemberDoc = jsonMemberAttribute[i]['attribute_value'];
print(
"already filled this section before. nomor npwp = $getIdFotoNPWPMemberAttr + $getIdFotoNPWPMemberDoc");
} else if (jsonMemberAttribute[i]['attribute_name'] ==
'identity_doc_id') {
getIdFotoKTPMemberAttr = jsonMemberAttribute[i]['id'];
getIdFotoKTPMemberDoc = jsonMemberAttribute[i]['attribute_value'];
print(
"already filled this section before. nomor npwp = $getIdFotoKTPMemberAttr + $getIdFotoKTPMemberDoc");
} else if (jsonMemberAttribute[i]['attribute_name'] == 'kyc_progress') {
var map = (jsonMemberAttribute[i] as Map<String, dynamic>);
idKYC = map['id'];
......@@ -86,6 +126,12 @@ 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));
setState(() {
if (alreadyFilledSection) {
_formNomorKTP.text = getNoKTP;
......@@ -100,6 +146,7 @@ class _DataIdentitasState extends State<DataIdentitas> {
.getImage(source: ImageSource.camera, imageQuality: 50);
setState(() {
_imageFileKTP = pickedImage;
validateImageKTP(_imageFileKTP);
});
}
......@@ -109,6 +156,7 @@ class _DataIdentitasState extends State<DataIdentitas> {
.getImage(source: ImageSource.camera, imageQuality: 50);
setState(() {
_imageFileNPWP = pickedImage;
validateImageNPWP(_imageFileNPWP);
});
}
......@@ -118,6 +166,7 @@ class _DataIdentitasState extends State<DataIdentitas> {
.getImage(source: ImageSource.camera, imageQuality: 50);
setState(() {
_imageFileFotoSelfie = pickedImage;
validateImageFotoSelfie(_imageFileFotoSelfie);
});
}
......@@ -127,9 +176,58 @@ class _DataIdentitasState extends State<DataIdentitas> {
.getImage(source: ImageSource.camera, imageQuality: 50);
setState(() {
_imageFileFotoSelfieDenganKTP = pickedImage;
validateImageFotoSelfieKTP(_imageFileFotoSelfieDenganKTP);
});
}
validateImageKTP(value) {
if (value != null) {
setState(() {
opacityRadio = 0;
});
} else {
setState(() {
opacityRadio = 1;
});
}
}
validateImageNPWP(value) {
if (value != null) {
setState(() {
opacityRadio = 0;
});
} else {
setState(() {
opacityRadio = 1;
});
}
}
validateImageFotoSelfie(value) {
if (value != null) {
setState(() {
opacityRadio = 0;
});
} else {
setState(() {
opacityRadio = 1;
});
}
}
validateImageFotoSelfieKTP(value) {
if (value != null) {
setState(() {
opacityRadio = 0;
});
} else {
setState(() {
opacityRadio = 1;
});
}
}
@override
Widget build(BuildContext context) {
return MaterialApp(
......@@ -140,6 +238,7 @@ class _DataIdentitasState extends State<DataIdentitas> {
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
IconButton(
key: Key('iconButtonAppBar'),
icon: Icon(
Icons.arrow_back,
color: primary,
......@@ -147,7 +246,7 @@ class _DataIdentitasState extends State<DataIdentitas> {
onPressed: () {
Navigator.push(context, MaterialPageRoute(
builder: (context) {
return BiodataKeluarga();
return HomeKYCUnregistered();
},
));
}),
......@@ -172,11 +271,11 @@ class _DataIdentitasState extends State<DataIdentitas> {
Container(
key: Key('container garis bulat checkpoint'),
child: Row(children: <Widget>[
buletanChecklistCheckpoint,
CheckpointBiodata,
garisCheckpoint,
buletanChecklistCheckpoint,
CheckpointAlamat,
garisCheckpoint,
buletanChecklistCheckpoint,
CheckpointBiodataKeluarga,
garisCheckpoint,
buletanChecklistCheckpoint,
garisCheckpoint,
......@@ -310,6 +409,19 @@ class _DataIdentitasState extends State<DataIdentitas> {
dottedBorderKTP()
])
])),
Container(
// margin: EdgeInsets.fromLTRB(10, 0, 0, 0),
child: Opacity(
opacity: opacityRadio,
child: Text(
'Harus diisi',
style: TextStyle(
color: formError,
fontSize: 12,
),
),
),
),
// form nomor npwp
Container(
......@@ -360,6 +472,19 @@ class _DataIdentitasState extends State<DataIdentitas> {
dottedBorderNPWP()
])
])),
Container(
// margin: EdgeInsets.fromLTRB(10, 0, 0, 0),
child: Opacity(
opacity: opacityRadio,
child: Text(
'Harus diisi',
style: TextStyle(
color: formError,
fontSize: 12,
),
),
),
),
// input foto selfie
Container(
......@@ -377,6 +502,19 @@ class _DataIdentitasState extends State<DataIdentitas> {
dottedBorderFotoSelfie()
])
])),
Container(
// margin: EdgeInsets.fromLTRB(10, 0, 0, 0),
child: Opacity(
opacity: opacityRadio,
child: Text(
'Harus diisi',
style: TextStyle(
color: formError,
fontSize: 12,
),
),
),
),
// input foto selfie dengan ktp dan tulisan
Container(
......@@ -394,6 +532,19 @@ class _DataIdentitasState extends State<DataIdentitas> {
dottedBorderFotoSelfieDenganKTP()
])
])),
Container(
// margin: EdgeInsets.fromLTRB(10, 0, 0, 0),
child: Opacity(
opacity: opacityRadio,
child: Text(
'Harus diisi',
style: TextStyle(
color: formError,
fontSize: 12,
),
),
),
),
// contoh foto
Container(
......@@ -418,21 +569,6 @@ class _DataIdentitasState extends State<DataIdentitas> {
])
])),
Container(
width: 343,
margin: const EdgeInsets.fromLTRB(0, 12, 0, 0),
child: Text(
"(*) Harus di isi",
textAlign: TextAlign.left,
style: TextStyle(
color: red1,
fontWeight: FontWeight.normal,
fontSize: 12,
fontFamily: 'Noto Sans',
),
),
),