Fakultas Ilmu Komputer UI

Commit 4f680741 authored by Ferdi Salim Sungkar's avatar Ferdi Salim Sungkar
Browse files

pulling from staging

parents 2c02fb62 a454bc5e
......@@ -169,6 +169,18 @@
"packageUri": "lib/",
"languageVersion": "2.9"
},
{
"name": "dependencies",
"rootUri": "file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/dependencies-0.1.5",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "disposables",
"rootUri": "file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/disposables-0.1.2",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "dotted_border",
"rootUri": "file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/dotted_border-1.0.7",
......@@ -283,6 +295,12 @@
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "grouped_checkbox",
"rootUri": "file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/grouped_checkbox-1.0.0",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "html",
"rootUri": "file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/html-0.15.0",
......@@ -361,6 +379,12 @@
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "material_floating_search_bar",
"rootUri": "file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/material_floating_search_bar-0.3.4",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "meta",
"rootUri": "file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.3.0",
......@@ -493,6 +517,12 @@
"packageUri": "lib/",
"languageVersion": "2.7"
},
{
"name": "quiver",
"rootUri": "file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/quiver-2.1.5",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "shelf",
"rootUri": "file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/shelf-1.1.0",
......@@ -674,7 +704,7 @@
"languageVersion": "2.7"
}
],
"generated": "2021-05-30T20:53:37.867369Z",
"generated": "2021-06-27T17:47:42.548840Z",
"generator": "pub",
"generatorVersion": "2.12.0"
}
......@@ -114,6 +114,14 @@ dart_style
2.9
file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/dart_style-1.3.12/
file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/dart_style-1.3.12/lib/
dependencies
2.0
file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/dependencies-0.1.5/
file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/dependencies-0.1.5/lib/
disposables
2.0
file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/disposables-0.1.2/
file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/disposables-0.1.2/lib/
dotted_border
2.2
file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/dotted_border-1.0.7/
......@@ -178,6 +186,10 @@ graphs
2.0
file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/graphs-0.2.0/
file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/graphs-0.2.0/lib/
grouped_checkbox
2.1
file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/grouped_checkbox-1.0.0/
file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/grouped_checkbox-1.0.0/lib/
html
2.12
file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/html-0.15.0/
......@@ -230,6 +242,10 @@ matcher
2.12
file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.10/
file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.10/lib/
material_floating_search_bar
2.12
file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/material_floating_search_bar-0.3.4/
file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/material_floating_search_bar-0.3.4/lib/
meta
2.12
file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.3.0/
......@@ -318,6 +334,10 @@ pubspec_parse
2.7
file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/pubspec_parse-0.1.8/
file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/pubspec_parse-0.1.8/lib/
quiver
2.0
file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/quiver-2.1.5/
file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/quiver-2.1.5/lib/
shelf
2.12
file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/shelf-1.1.0/
......
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_keyboard_visibility","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_keyboard_visibility-5.0.0/","dependencies":[]},{"name":"flutter_secure_storage","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.5/","dependencies":[]},{"name":"image_picker","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.7.4/","dependencies":[]},{"name":"path_provider","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.1/","dependencies":[]}],"android":[{"name":"flutter_keyboard_visibility","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_keyboard_visibility-5.0.0/","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android_lifecycle-2.0.1/","dependencies":[]},{"name":"flutter_secure_storage","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.5/","dependencies":[]},{"name":"image_picker","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.7.4/","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"path_provider","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.1/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-2.0.0/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.0.0/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.0/","dependencies":[]}],"web":[{"name":"flutter_keyboard_visibility_web","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_keyboard_visibility_web-2.0.0/","dependencies":[]},{"name":"image_picker_for_web","path":"/Users/ferdisungkar/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-05-31 04:09:27.124675","version":"2.0.1"}
\ 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":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_keyboard_visibility-5.0.0/","dependencies":[]},{"name":"flutter_secure_storage","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.5/","dependencies":[]},{"name":"image_picker","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.7.4/","dependencies":[]},{"name":"path_provider","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.1/","dependencies":[]}],"android":[{"name":"flutter_keyboard_visibility","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_keyboard_visibility-5.0.0/","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android_lifecycle-2.0.1/","dependencies":[]},{"name":"flutter_secure_storage","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.5/","dependencies":[]},{"name":"image_picker","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.7.4/","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"path_provider","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.1/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-2.0.0/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.0.0/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.0/","dependencies":[]}],"web":[{"name":"flutter_keyboard_visibility_web","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_keyboard_visibility_web-2.0.0/","dependencies":[]},{"name":"image_picker_for_web","path":"/Users/ferdisungkar/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-28 00:47:42.694881","version":"2.0.1"}
\ No newline at end of file
......@@ -41,5 +41,12 @@ app.*.symbols
# Obfuscation related
app.*.map.json
<<<<<<< HEAD
=======
# coverage files
coverage/
<<<<<<< HEAD
>>>>>>> e72f1abdf984d208252d84b30d0a294773b31097
=======
>>>>>>> 63710dd0e96fcb5fcb77dd1c61325f331dc52963
>>>>>>> 3f2b9c57e2dfac07786ae9327da380d13bae9458
......@@ -3,7 +3,7 @@
#
# For more info see: https://dart.dev/go/dot-packages-deprecation
#
# Generated by pub on 2021-05-31 03:53:37.840779.
# Generated by pub on 2021-06-28 00:47:42.522056.
_fe_analyzer_shared:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/_fe_analyzer_shared-14.0.0/lib/
analyzer:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-0.41.2/lib/
args:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/args-2.0.0/lib/
......@@ -32,6 +32,8 @@ crypto:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/cry
csslib:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/csslib-0.17.0/lib/
cupertino_icons:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-1.0.2/lib/
dart_style:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/dart_style-1.3.12/lib/
dependencies:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/dependencies-0.1.5/lib/
disposables:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/disposables-0.1.2/lib/
dotted_border:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/dotted_border-1.0.7/lib/
fake_async:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/fake_async-1.2.0/lib/
ffi:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/ffi-1.0.0/lib/
......@@ -51,6 +53,7 @@ flutter_web_plugins:file:///Users/ferdisungkar/flutter/packages/flutter_web_plug
glob:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/glob-2.0.1/lib/
google_fonts:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/google_fonts-2.0.0/lib/
graphs:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/graphs-0.2.0/lib/
grouped_checkbox:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/grouped_checkbox-1.0.0/lib/
html:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/html-0.15.0/lib/
http:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.13.0/lib/
http_multi_server:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/http_multi_server-2.2.0/lib/
......@@ -64,6 +67,7 @@ js:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.
json_annotation:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/json_annotation-4.0.1/lib/
logging:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/logging-1.0.1/lib/
matcher:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.10/lib/
material_floating_search_bar:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/material_floating_search_bar-0.3.4/lib/
meta:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.3.0/lib/
mime:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/mime-1.0.0/lib/
mockito:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/mockito-4.1.4/lib/
......@@ -86,6 +90,7 @@ pool:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/pool-
process:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/process-4.2.1/lib/
pub_semver:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/pub_semver-2.0.0/lib/
pubspec_parse:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/pubspec_parse-0.1.8/lib/
quiver:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/quiver-2.1.5/lib/
shelf:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/shelf-1.1.0/lib/
shelf_packages_handler:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/shelf_packages_handler-2.0.1/lib/
shelf_static:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/shelf_static-0.2.9+2/lib/
......
This diff is collapsed.
......@@ -24,6 +24,7 @@ const gray5 = Color.fromRGBO(224, 224, 224, 1.0);
// Element Colors
const red1 = Color.fromRGBO(159, 25, 25, 1.0);
const formError = Color.fromRGBO(211, 47, 47, 1.0);
const info = Color.fromRGBO(151, 182, 255, 1.0);
// Color for Akun
......
......@@ -60,12 +60,14 @@ class _RegisterAgreementState extends State<RegisterAgreement> {
flex: 0,
child: Container(
margin: const EdgeInsets.fromLTRB(0, 0, 0, 16),
child: Text('Syarat dan Ketentuan Pemodal',
key: Key('syaratKetentuan'),
style: GoogleFonts.inter(
fontSize: 18,
fontWeight: FontWeight.bold,
)),
child: Text(
'Syarat dan Ketentuan Pemodal',
key: Key('syaratKetentuan'),
style: GoogleFonts.inter(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
),
),
Expanded(
......
......@@ -12,21 +12,24 @@ class ValidasiAlamat {
}
}
String provinsi;
class ValidasiTempat {
static String validate(String value) {
return value.isEmpty ? 'Provinsi harus di isi' : null;
return value.isEmpty ? 'Provinsi harus di isi' : provinsi = value;
}
}
String kabupaten;
class ValidasiKabupaten {
static String validate(String value) {
return value.isEmpty ? 'Kabupaten harus di isi' : null;
return value.isEmpty ? 'Kabupaten harus di isi' : kabupaten = value;
}
}
String kecamatan;
class ValidasiKecamatan {
static String validate(String value) {
return value.isEmpty ? 'Kecamatan harus di isi' : null;
return value.isEmpty ? 'Kecamatan harus di isi' : kecamatan = value;
}
}
......@@ -55,6 +58,27 @@ class ValidasiKodePos {
}
}
String provinsiTambahan;
class ValidasiTempatTambahan {
static String validate(String value) {
return value.isEmpty ? 'Provinsi harus di isi' : provinsiTambahan = value;
}
}
String kabupatenTambahan;
class ValidasiKabupatenTambahan {
static String validate(String value) {
return value.isEmpty ? 'Kabupaten harus di isi' : kabupatenTambahan = value;
}
}
String kecamatanTambahan;
class ValidasiKecamatanTambahan {
static String validate(String value) {
return value.isEmpty ? 'Kecamatan harus di isi' : kecamatanTambahan = value;
}
}
class AlamatBody extends StatefulWidget {
AlamatBody({Key key}) : super(key: key);
......@@ -653,10 +677,14 @@ class _AlamatBodyState extends State<AlamatBody> {
return;
}
if (_checkBox == true) {
Api().postAddress(_alamatDomisili, _pilihKecamatanTambahan, _pilihKabupatenTambahan, _pilihProvinsiTambahan, _kodePosTambahan);
Api().enable_domicile();
Api().postAddress(_alamatDomisili, kecamatanTambahan,
kabupatenTambahan, provinsiTambahan, _kodePosTambahan);
}
Api().postAddress(_alamatLengkap, _pilihKecamatan, _pilihKabupaten, _selectedCity, _kodePos);
Api().postAddress(_alamatLengkap, kecamatan, kabupaten, provinsi, _kodePos);
Api().domicile_address_id();
// Api().kyc_progress(true, true, false, false, false);
Navigator.push(context,
MaterialPageRoute(builder: (context) {
......@@ -694,6 +722,8 @@ class _AlamatBodyState extends State<AlamatBody> {
));
}
// ignore: unused_field
String _alamatDomisili;
// ignore: unused_field
......@@ -766,7 +796,7 @@ class _AlamatBodyState extends State<AlamatBody> {
suggestion;
},
// ignore: missing_return
validator: ValidasiTempat.validate,
validator: ValidasiTempatTambahan.validate,
onSaved: (value) => this._pilihProvinsiTambahan = value,
),
),
......@@ -804,7 +834,7 @@ class _AlamatBodyState extends State<AlamatBody> {
suggestion;
},
// ignore: missing_return
validator: ValidasiKabupaten.validate,
validator: ValidasiKabupatenTambahan.validate,
onSaved: (value) =>
this._pilihKabupatenTambahan = value,
),
......@@ -842,7 +872,7 @@ class _AlamatBodyState extends State<AlamatBody> {
suggestion;
},
// ignore: missing_return
validator: ValidasiKecamatan.validate,
validator: ValidasiKecamatanTambahan.validate,
onSaved: (value) =>
this._pilihKecamatanTambahan = value,
),
......@@ -898,4 +928,4 @@ class _AlamatBodyState extends State<AlamatBody> {
return Container();
}
}
}
\ No newline at end of file
}
This diff is collapsed.
import 'package:flutter/material.dart';
import 'package:fundex_app/api/api.dart';
import 'package:fundex_app/assets/colors.dart';
import 'package:fundex_app/pages/kyc/alamat_body.dart';
import 'package:fundex_app/pages/kyc/data_identitas.dart';
......@@ -17,27 +18,150 @@ 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();
}
validateRadioButton(value) {
selectedRadio = value;
if (selectedRadio == 0) {
setState(() {
opacityRadio = 1;
});
} else if (selectedRadio == 1) {
setState(() {
statusPernikahan = 'single';
opacityRadio = 0;
});
} else if (selectedRadio == 2) {
getNamaPasangan();
setState(() {
statusPernikahan = 'married';
opacityRadio = 0;
});
} else {
setState(() {
statusPernikahan = 'widow';
opacityRadio = 0;
});
}
}
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");
}
setSelectedRadio(int val) {
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;
}
});
}
......@@ -303,7 +427,7 @@ class _BiodataKeluargaBodyState extends State<BiodataKeluarga> {
activeColor: primary,
onChanged: (val) {
print("radio $val");
setSelectedRadio(val);
validateRadioButton(val);
}),
Text(
"Belum Menikah",
......@@ -325,7 +449,7 @@ class _BiodataKeluargaBodyState extends State<BiodataKeluarga> {
activeColor: primary,
onChanged: (val) {
print("radio $val");
setSelectedRadio(val);
validateRadioButton(val);
}),
Text(
"Menikah",
......@@ -347,7 +471,7 @@ class _BiodataKeluargaBodyState extends State<BiodataKeluarga> {
activeColor: primary,
onChanged: (val) {
print("radio $val");
setSelectedRadio(val);
validateRadioButton(val);
}),
Text(
"Duda/Janda",
......@@ -362,6 +486,19 @@ class _BiodataKeluargaBodyState extends State<BiodataKeluarga> {
),
])
])),
Container(
margin: EdgeInsets.fromLTRB(10, 0, 0, 0),
child: Opacity(
opacity: opacityRadio,
child: Text(
'Harus diisi',
style: TextStyle(
color: formError,
fontSize: 12,
),
),
),
),
jikaMenikah(),
......@@ -385,6 +522,7 @@ class _BiodataKeluargaBodyState extends State<BiodataKeluarga> {
key: Key('nama'),
keyboardType: TextInputType.text,
decoration: formInputDecoration(),
controller: _formNamaGadisIbuKandung,
validator: ValidasiNama.validate,
onChanged: (String value) {
_namaGadisIbu = value;
......@@ -415,10 +553,14 @@ class _BiodataKeluargaBodyState extends State<BiodataKeluarga> {
child: TextFormField(
key: Key('namaAhli'),
keyboardType: TextInputType.text,
controller: _formNamaAhliWaris,
decoration: formInputDecoration(),
onSaved: (String namaLengkap) {
_namaAhli = namaLengkap;
},
onChanged: (String namaLengkap) {
_namaAhli = namaLengkap;
},
),
),
])
......@@ -443,8 +585,12 @@ class _BiodataKeluargaBodyState extends State<BiodataKeluarga> {
key: Key('namaHubunganAhli'),
keyboardType: TextInputType.text,
decoration: formInputDecoration(),
onSaved: (String namaLengkap) {
_hubunganAhli = namaLengkap;
controller: _formHubunganDenganAhliWaris,
onSaved: (String value) {
_hubunganAhli = value;
},
onChanged: (String value) {
_hubunganAhli = value;
},
),
),
......@@ -471,8 +617,12 @@ class _BiodataKeluargaBodyState extends State<BiodataKeluarga> {
key: Key('nomor'),
keyboardType: TextInputType.phone,
decoration: formInputDecoration(),
onSaved: (String nomor) {
_nomorHandphone = nomor;
controller: _formPhoneAhliWaris,
onSaved: (String value) {
_nomorHandphone = value;
},
onChanged: (String value) {
_nomorHandphone = value;
},
),
),
......@@ -497,9 +647,13 @@ class _BiodataKeluargaBodyState extends State<BiodataKeluarga> {
child: TextFormField(
key: Key('keyAlamatAhli'),
keyboardType: TextInputType.text,
controller: _formAlamatAhliWaris,
decoration: formInputDecoration(),
onSaved: (String namaLengkap) {
_alamatAhli = namaLengkap;
onSaved: (String value) {
_alamatAhli = value;
},
onChanged: (String value) {
_alamatAhli = value;
},
),
),
......@@ -567,9 +721,59 @@ class _BiodataKeluargaBodyState extends State<BiodataKeluarga> {
return;
}
if (selectedRadio == 0) {
validateRadioButton(selectedRadio);
print("Failed2");
return;
}