Fakultas Ilmu Komputer UI

Commit 28de8e82 authored by Muhammad Farhan Ghaffar's avatar Muhammad Farhan Ghaffar
Browse files

feat: adding loading for KYC

parents 13093c95 345d74b4
Pipeline #83810 failed with stages
in 5 minutes and 3 seconds
......@@ -253,6 +253,12 @@
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "flutter_spinkit",
"rootUri": "file:///D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_spinkit-4.1.2+1",
"packageUri": "lib/",
"languageVersion": "2.5"
},
{
"name": "flutter_svg",
"rootUri": "file:///D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.19.3",
......@@ -704,7 +710,7 @@
"languageVersion": "2.7"
}
],
"generated": "2021-06-27T16:36:25.618255Z",
"generated": "2021-06-27T17:58:13.413968Z",
"generator": "pub",
"generatorVersion": "2.13.0"
}
......@@ -166,6 +166,10 @@ flutter_secure_storage
2.1
file:///D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.5/
file:///D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.5/lib/
flutter_spinkit
2.5
file:///D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_spinkit-4.1.2+1/
file:///D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_spinkit-4.1.2+1/lib/
flutter_svg
2.2
file:///D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.19.3/
......
{"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-28 00:02:05.138696","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-28 01:20:27.502450","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-27 23:36:25.508548.
# Generated by pub on 2021-06-28 00:58:12.976281.
_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/
......@@ -46,6 +46,7 @@ flutter_keyboard_visibility_web:file:///D:/src/flutter/.pub-cache/hosted/pub.dar
flutter_multi_carousel:file:///D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_multi_carousel-1.0.3/lib/
flutter_plugin_android_lifecycle:file:///D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android_lifecycle-2.0.1/lib/
flutter_secure_storage:file:///D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.5/lib/
flutter_spinkit:file:///D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_spinkit-4.1.2+1/lib/
flutter_svg:file:///D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.19.3/lib/
flutter_test:file:///D:/src/flutter/packages/flutter_test/lib/
flutter_typeahead:file:///D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_typeahead-3.1.1/lib/
......
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
class Loading extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
color: Colors.white,
child: Center(
child: SpinKitCircle(
color: Color.fromRGBO(18, 40, 75, 1),
size: 100.0,
duration: const Duration(milliseconds: 700),
),
),
);
}
}
import 'package:flutter/cupertino.dart';
import 'package:intl/intl.dart';
import 'package:time_formatter/time_formatter.dart';
......@@ -103,4 +104,20 @@ class Ukm {
String get beautifyTime {
return formatTime(remainingTime);
}
ImageProvider<Object> get ukmBanner {
if (this.bannerImg == "") {
return AssetImage('assets/images/equityWithNoImage.jpg');
} else {
return NetworkImage(this.bannerImg);
}
}
Widget ukmLogo(String logoUrl) {
try {
return Image.network(this.logoUrl);
} catch (e) {
return Image.asset('assets/images/tidak-ada-perjanjian.png');
}
}
}
This diff is collapsed.
......@@ -2,6 +2,7 @@ import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:fundex_app/api/api.dart';
import 'package:fundex_app/assets/loading.dart';
import 'package:fundex_app/pages/business/cardsListOnHome.dart';
import 'package:fundex_app/pages/business/prospectus_page.dart';
import 'package:google_fonts/google_fonts.dart';
......@@ -19,7 +20,10 @@ class HomeKYC extends StatefulWidget {
class _HomeKYCState extends State<HomeKYC> {
Future<EquityOfferings> futureEquities;
bool alreadyFilledSection = false;
bool alreadyRegistered = false;
bool userChecked = false;
bool lihatSemuaIsClicked = false;
List<Ukm> ukmList = [];
void initState() {
super.initState();
......@@ -29,7 +33,7 @@ class _HomeKYCState extends State<HomeKYC> {
Widget buildUkmCarousel(BuildContext context,
AsyncSnapshot<EquityOfferings> snapshot, int index) {
List<Ukm> ukmList = snapshot.data.getUkmList();
ukmList = snapshot.data.getUkmList();
return new Container(
alignment: Alignment.center,
margin: EdgeInsets.fromLTRB(0.0, 24.0, 0.0, 0.0),
......@@ -57,10 +61,21 @@ class _HomeKYCState extends State<HomeKYC> {
ProspectusPage((ukmList[index].id).toString())));
},
child: Container(
margin: EdgeInsets.fromLTRB(0.0, 16.0, 0.0, 16.0),
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 0,
blurRadius: 8,
offset: Offset(0, 0), // changes position of shadow
),
],
),
child: Column(
children: [
Expanded(
flex: 7,
flex: 8,
child: Container(
key: Key('containerForWholeCarousel'),
decoration: BoxDecoration(
......@@ -69,7 +84,7 @@ class _HomeKYCState extends State<HomeKYC> {
topRight: Radius.circular(8.0),
),
image: DecorationImage(
image: NetworkImage(ukmList[index].bannerImg),
image: ukmList[index].ukmBanner,
fit: BoxFit.cover,
),
),
......@@ -86,15 +101,6 @@ class _HomeKYCState extends State<HomeKYC> {
bottomLeft: Radius.circular(8.0),
bottomRight: Radius.circular(8.0),
),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 0,
blurRadius: 8,
offset:
Offset(0, 0), // changes position of shadow
),
],
),
alignment: Alignment.center,
child: Column(
......@@ -109,10 +115,8 @@ class _HomeKYCState extends State<HomeKYC> {
flex: 2,
child: Container(
margin: EdgeInsets.fromLTRB(8, 0, 8, 0),
child: Image.network(
ukmList[index].logoUrl,
key: Key('ukmLogo'),
),
child: ukmList[index]
.ukmLogo(ukmList[index].logoUrl),
),
),
Expanded(
......@@ -371,85 +375,93 @@ class _HomeKYCState extends State<HomeKYC> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
resizeToAvoidBottomInset: false,
appBar: AppBar(
backgroundColor: Colors.white,
title: Image.asset(
'assets/images/fundex.png',
key: Key('logoFundex'),
),
),
body: SafeArea(
child: SingleChildScrollView(
child: Column(
key: Key('wholePageColumn'),
crossAxisAlignment: CrossAxisAlignment.start,
children: [
getCard(),
Container(
alignment: Alignment.center,
key: Key('containerPenawaranAndLihatSemua'),
margin: EdgeInsets.fromLTRB(24.0, 0.0, 24.0, 0.0),
child: Row(
key: Key('rowPenawaranAndLihatSemua'),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
'Penawaran',
key: Key('stringPenawaran'),
style: GoogleFonts.inter(
color: Color.fromRGBO(0, 0, 0, 1.0),
fontSize: 16.0,
),
),
RichText(
key: Key('stringLihatSemua'),
text: TextSpan(
text: 'Lihat Semua >>',
return userChecked == false || lihatSemuaIsClicked == true
? Loading()
: Scaffold(
backgroundColor: Colors.white,
resizeToAvoidBottomInset: false,
appBar: AppBar(
backgroundColor: Colors.white,
title: Image.asset(
'assets/images/fundex.png',
key: Key('logoFundex'),
),
),
body: SafeArea(
child: SingleChildScrollView(
child: Column(
key: Key('wholePageColumn'),
crossAxisAlignment: CrossAxisAlignment.start,
children: [
getCard(),
Container(
alignment: Alignment.center,
key: Key('containerPenawaranAndLihatSemua'),
margin: EdgeInsets.fromLTRB(24.0, 0.0, 24.0, 0.0),
child: Row(
key: Key('rowPenawaranAndLihatSemua'),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
'Penawaran',
key: Key('stringPenawaran'),
style: GoogleFonts.inter(
color: Color.fromRGBO(189, 189, 189, 1.0),
fontSize: 12.0,
color: Color.fromRGBO(0, 0, 0, 1.0),
fontSize: 16.0,
),
recognizer: TapGestureRecognizer()
..onTap = () {
Navigator.push(context,
MaterialPageRoute(builder: (context) {
return MaterialApp(home: ExploreBusiness());
}));
})),
]),
),
Container(
alignment: Alignment.center,
margin: EdgeInsets.fromLTRB(0.0, 24.0, 0.0, 0.0),
child: FutureBuilder<EquityOfferings>(
future: futureEquities,
builder: (context, snapshot) {
if (snapshot.hasData) {
return buildUkmCarousel(context, snapshot,
snapshot.data.getUkmList().length);
),
RichText(
key: Key('stringLihatSemua'),
text: TextSpan(
text: 'Lihat Semua >>',
style: GoogleFonts.inter(
color: Color.fromRGBO(189, 189, 189, 1.0),
fontSize: 12.0,
),
recognizer: TapGestureRecognizer()
..onTap = () {
setState(() {
lihatSemuaIsClicked = true;
});
Navigator.push(context,
MaterialPageRoute(
builder: (context) {
return MaterialApp(
home: ExploreBusiness());
}));
})),
]),
),
Container(
alignment: Alignment.center,
margin: EdgeInsets.fromLTRB(0.0, 24.0, 0.0, 0.0),
child: FutureBuilder<EquityOfferings>(
future: futureEquities,
builder: (context, snapshot) {
if (snapshot.hasData) {
return buildUkmCarousel(context, snapshot,
snapshot.data.getUkmList().length);
// SingleChildScrollView(
// scrollDirection: Axis.vertical,
// child: buildUkmCard(context, snapshot));
} else if (snapshot.hasError) {
print('${snapshot.error}');
return Container(child: Text('${snapshot.error}'));
} else {
return Container(
width: 0,
height: 0,
);
}
}),
// SingleChildScrollView(
// scrollDirection: Axis.vertical,
// child: buildUkmCard(context, snapshot));
} else if (snapshot.hasError) {
print('${snapshot.error}');
return Container(
child: Text('${snapshot.error}'));
} else {
return Container(
width: 0,
height: 0,
);
}
}),
),
],
),
),
],
),
),
),
);
),
);
}
Future checkUser() async {
......@@ -460,19 +472,22 @@ class _HomeKYCState extends State<HomeKYC> {
var map = (getMemberAttribute[i] as Map<String, dynamic>);
var val = (map)['attribute_value'];
var str = val.substring(1, val.length - 1);
var step1 = str.split(",")[4];
var value = step1.substring(8);
var lastStep = str.split(",")[4];
var value = lastStep.substring(8);
if (value == "true") {
setState(() {
alreadyFilledSection = true;
alreadyRegistered = true;
});
}
setState(() {
userChecked = true;
});
}
}
}
Widget getCard() {
if (alreadyFilledSection == true) {
if (alreadyRegistered == true) {
return registeredUser(context);
} else {
return unregisteredUser(context);
......
......@@ -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/assets/loading.dart';
import 'package:fundex_app/pages/business/homekyc.dart';
import 'package:fundex_app/pages/kyc/biodata_body.dart';
import 'package:fundex_app/pages/kyc/biodata_keluarga_body.dart';
......@@ -142,6 +143,7 @@ class _AlamatBodyState extends State<AlamatBody> {
var valStep5;
void initState(){
load == false ? Loading() :
super.initState();
init();
}
......@@ -270,10 +272,12 @@ class _AlamatBodyState extends State<AlamatBody> {
return matches;
}
bool load = false;
@override
Widget build(BuildContext context) {
return MaterialApp(
return alreadyFilledSection == true && getzipcode == null ? Loading() :
MaterialApp(
home: Scaffold(
appBar: AppBar(
backgroundColor: white,
......@@ -286,6 +290,9 @@ class _AlamatBodyState extends State<AlamatBody> {
color: primary,
),
onPressed: () {
setState(() {
load = true;
});
Navigator.push(context, MaterialPageRoute(builder: (context) {
return HomeKYC();
}));
......@@ -340,6 +347,9 @@ class _AlamatBodyState extends State<AlamatBody> {
color: white,
size: 16),
onPressed: () {
setState(() {
load = true;
});
Navigator.push(context, MaterialPageRoute(builder: (context) {
return BiodataBody();
}));
......@@ -864,6 +874,9 @@ class _AlamatBodyState extends State<AlamatBody> {
print("Failed");
return;
}
setState(() {
load = true;
});
if (alreadyFilledSection == true) {
print(
......
......@@ -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/assets/loading.dart';
import 'package:fundex_app/pages/business/homekyc.dart';
import 'package:fundex_app/pages/kyc/alamat_body.dart';
import 'package:fundex_app/pages/kyc/biodata_keluarga_body.dart';
......@@ -235,7 +236,8 @@ class _BiodataBodyState extends State<BiodataBody> {
}
Widget build(BuildContext context) {
return MaterialApp(
return alreadyFilledSection == true && city == null ? Loading() :
MaterialApp(
home: Scaffold(
appBar: AppBar(
backgroundColor: white,
......
import 'package:flutter/material.dart';
import 'package:fundex_app/api/api.dart';
import 'package:fundex_app/assets/colors.dart';
import 'package:fundex_app/assets/loading.dart';
import 'package:fundex_app/pages/business/homekyc.dart';
import 'package:fundex_app/pages/kyc/alamat_body.dart';
import 'package:fundex_app/pages/kyc/biodata_body.dart';
......@@ -182,7 +183,8 @@ class _BiodataKeluargaBodyState extends State<BiodataKeluarga> {
}
Widget build(BuildContext context) {
return MaterialApp(
return alreadyFilledSection == true && _alamatAhli == null ? Loading() :
MaterialApp(
home: Scaffold(
appBar: AppBar(
backgroundColor: white,
......
......@@ -2,6 +2,7 @@ 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/assets/loading.dart';
import 'package:fundex_app/main-screen.dart';
import 'package:fundex_app/pages/business/homekyc.dart';
import 'package:fundex_app/pages/kyc/alamat_body.dart';
......@@ -551,7 +552,8 @@ class _DataPendukungState extends State<DataPendukung> {
),
];
return MaterialApp(
return alreadyFilledSection == true && getPosition == null ? Loading() :
MaterialApp(
home: Scaffold(
appBar: AppBar(
backgroundColor: white,
......
......@@ -4,6 +4,7 @@ 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/assets/loading.dart';
import 'package:fundex_app/pages/business/homekyc.dart';
import 'package:fundex_app/pages/kyc/alamat_body.dart';
import 'package:fundex_app/pages/kyc/biodata_body.dart';
......@@ -11,7 +12,7 @@ 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';
import 'package:image_picker/image_picker.dart';
import 'package:fundex_app/storage/storage.dart';
// import 'package:fundex_app/storage/storage.dart';
class DataIdentitas extends StatefulWidget {
@override
......@@ -254,7 +255,8 @@ class _DataIdentitasState extends State<DataIdentitas> {
@override
Widget build(BuildContext context) {
return MaterialApp(
return getFotoSelfieKtp == null && alreadyFilledSection == true ? Loading() :
MaterialApp(
home: Scaffold(
appBar: AppBar(
backgroundColor: white,
......@@ -655,12 +657,12 @@ class _DataIdentitasState extends State<DataIdentitas> {
return;
}
// print('yu'+_imageFileKTP);
print('ya'+_imageFileKTP.path);
print(File(_imageFileKTP.path));
print(File(_imageFileKTP.path).path.split('/').last);
print(File(_imageFileKTP.path).readAsBytes().asStream());
print(File(_imageFileKTP.path).length());
print(File(_imageFileKTP.path).lengthSync());
// print('ya'+_imageFileKTP.path);
// print(File(_imageFileKTP.path));
// print(File(_imageFileKTP.path).path.split('/').last);
// print(File(_imageFileKTP.path).readAsBytes().asStream());
// print(File(_imageFileKTP.path).length());
// print(File(_imageFileKTP.path).lengthSync());
// String fileNameKTP = _imageFileKTP.path.split('/').last;
// String fileNameNPWP = _imageFileNPWP.path.split('/').last;
// String fileNameFotoSelfie = _imageFileFotoSelfie.path.split('/').last;
......@@ -675,18 +677,18 @@ class _DataIdentitasState extends State<DataIdentitas> {
'identity_number', _noKTP);
Api().putMemberAttribute(getIdNoNPWP,
'npwp_number', _noPWP);
Api().postFotoMemberDoc(_imageFileKTP, 'id_DOCidentitydocid');
Api().putMemberAttribute(getIdFotoKTPMemberAttr,
'identity_doc_id', await SecureStorage().readSecureData('id_DOCidentitydocid'));
Api().postFotoMemberDoc(_imageFileKTP, 'id_DOCidentitydocid');
Api().putMemberAttribute(getIdFotoNPWPMemberAttr,
'npwp_doc_id', await SecureStorage().readSecureData('id_DOCnpwpdocid'));
Api().postFotoMemberDoc(_imageFileKTP, 'id_DOCidentitydocid');
Api().putMemberAttribute(getIdFotoSelfieMemberAttr,
'selfie_photo_doc_id', await SecureStorage().readSecureData('id_DOCselfiephotodocid'));
Api().postFotoMemberDoc(_imageFileKTP, 'id_DOCidentitydocid');
Api().putMemberAttribute(getIdFotoSelfieKtpMemberAttr,
'selfie_additional_doc_id', await SecureStorage().readSecureData('id_DOCselfieadditionaldocid'));
// Api().postFotoMemberDoc(_imageFileKTP, 'id_DOCidentitydocid');
// Api().putMemberAttribute(getIdFotoKTPMemberAttr,
// 'identity_doc_id', await SecureStorage().readSecureData('id_DOCidentitydocid'));
// Api().postFotoMemberDoc(_imageFileKTP, 'id_DOCidentitydocid');
// Api().putMemberAttribute(getIdFotoNPWPMemberAttr,
// 'npwp_doc_id', await SecureStorage().readSecureData('id_DOCnpwpdocid'));
// Api().postFotoMemberDoc(_imageFileKTP, 'id_DOCidentitydocid');
// Api().putMemberAttribute(getIdFotoSelfieMemberAttr,
// 'selfie_photo_doc_id', await SecureStorage().readSecureData('id_DOCselfiephotodocid'));
// Api().postFotoMemberDoc(_imageFileKTP, 'id_DOCidentitydocid');
// Api().putMemberAttribute(getIdFotoSelfieKtpMemberAttr,
// 'selfie_additional_doc_id', await SecureStorage().readSecureData('id_DOCselfieadditionaldocid'));
} else {
Api().identity_number(_noKTP);
Api().npwp_number(_noPWP);
......
import 'package:flutter/material.dart';
import 'package:fundex_app/api/api.dart';
import 'package:fundex_app/main-screen.dart';
import 'package:fundex_app/pages/kyc/design.dart';
import 'package:fundex_app/storage/storage.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:fundex_app/assets/colors.dart';
class CancelConfirmation extends StatefulWidget {
@override
_CancelConfirmationState createState() => _CancelConfirmationState();
......@@ -287,6 +289,11 @@ class __OtpFormState extends State<_OtpForm> {
String stringValue = value.toString();
otpString = otpString + stringValue;
pin6FocusNode.unfocus();
Api().otpInput(
await SecureStorage().readSecureData('token'), otpString);
Navigator.push(context, MaterialPageRoute(builder: (context) {