Fakultas Ilmu Komputer UI

Commit 3b4d6333 authored by Habel Christiando Tobing's avatar Habel Christiando Tobing
Browse files

improved homekyc.

parent 6ba140ad
Pipeline #83625 passed with stages
in 7 minutes and 10 seconds
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_keyboard_visibility","path":"D:\\\\Program Files\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility-5.0.0\\\\","dependencies":[]},{"name":"flutter_secure_storage","path":"D:\\\\Program Files\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-3.3.5\\\\","dependencies":[]},{"name":"image_picker","path":"D:\\\\Program Files\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker-0.7.4\\\\","dependencies":[]},{"name":"path_provider","path":"D:\\\\Program Files\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]}],"android":[{"name":"flutter_keyboard_visibility","path":"D:\\\\Program Files\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility-5.0.0\\\\","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","path":"D:\\\\Program Files\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_plugin_android_lifecycle-2.0.1\\\\","dependencies":[]},{"name":"flutter_secure_storage","path":"D:\\\\Program Files\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-3.3.5\\\\","dependencies":[]},{"name":"image_picker","path":"D:\\\\Program Files\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker-0.7.4\\\\","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"path_provider","path":"D:\\\\Program Files\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"D:\\\\Program Files\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-2.0.0\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"D:\\\\Program Files\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-2.0.0\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"D:\\\\Program Files\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-2.0.0\\\\","dependencies":[]}],"web":[{"name":"flutter_keyboard_visibility_web","path":"D:\\\\Program Files\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility_web-2.0.0\\\\","dependencies":[]},{"name":"image_picker_for_web","path":"D:\\\\Program Files\\\\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 07:28:30.803999","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":"D:\\\\Program Files\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility-5.0.0\\\\","dependencies":[]},{"name":"flutter_secure_storage","path":"D:\\\\Program Files\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-3.3.5\\\\","dependencies":[]},{"name":"image_picker","path":"D:\\\\Program Files\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker-0.7.4\\\\","dependencies":[]},{"name":"path_provider","path":"D:\\\\Program Files\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]}],"android":[{"name":"flutter_keyboard_visibility","path":"D:\\\\Program Files\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility-5.0.0\\\\","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","path":"D:\\\\Program Files\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_plugin_android_lifecycle-2.0.1\\\\","dependencies":[]},{"name":"flutter_secure_storage","path":"D:\\\\Program Files\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-3.3.5\\\\","dependencies":[]},{"name":"image_picker","path":"D:\\\\Program Files\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker-0.7.4\\\\","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"path_provider","path":"D:\\\\Program Files\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"D:\\\\Program Files\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-2.0.0\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"D:\\\\Program Files\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-2.0.0\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"D:\\\\Program Files\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-2.0.0\\\\","dependencies":[]}],"web":[{"name":"flutter_keyboard_visibility_web","path":"D:\\\\Program Files\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility_web-2.0.0\\\\","dependencies":[]},{"name":"image_picker_for_web","path":"D:\\\\Program Files\\\\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-27 01:45:16.239836","version":"2.0.1"}
\ No newline at end of file
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/tidak-ada-perjanjian.png');
} 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.
......@@ -19,7 +19,7 @@ class HomeKYC extends StatefulWidget {
class _HomeKYCState extends State<HomeKYC> {
Future<EquityOfferings> futureEquities;
bool alreadyFilledSection = false;
bool alreadyRegistered = false;
void initState() {
super.initState();
......@@ -57,6 +57,17 @@ 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(
......@@ -69,7 +80,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 +97,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 +111,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(
......@@ -460,11 +460,11 @@ 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(",")[0];
var value = step1.substring(8);
var lastStep = str.split(",")[4];
var value = lastStep.substring(8);
if (value == "true") {
setState(() {
alreadyFilledSection = true;
alreadyRegistered = true;
});
}
}
......@@ -472,7 +472,7 @@ class _HomeKYCState extends State<HomeKYC> {
}
Widget getCard() {
if (alreadyFilledSection == true) {
if (alreadyRegistered == true) {
return registeredUser(context);
} else {
return unregisteredUser(context);
......
......@@ -293,6 +293,7 @@ class __OtpFormState extends State<_OtpForm> {
pin6FocusNode.unfocus();
Api().otpInput(
await SecureStorage().readSecureData('token'), otpString);
await new Future.delayed(const Duration(seconds: 5));
Navigator.push(context, MaterialPageRoute(builder: (context) {
return MaterialApp(home: HomeKYC());
}));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment