Fakultas Ilmu Komputer UI

Commit acf1d0e1 authored by Manuel Yoseph Ray's avatar Manuel Yoseph Ray
Browse files

Merge branch 'PBI-39-transaksi-riwayat' of...

Merge branch 'PBI-39-transaksi-riwayat' of https://gitlab.cs.ui.ac.id/ppl-fasilkom-ui/2021/DD/fundex.id-security-crowdfunding-mobile-application/ppl2021-d-slhape into PBI-39-transaksi-riwayat
parents 896ef801 a0897270
This diff is collapsed.
This diff is collapsed.
2.1.0-12.1.pre
\ No newline at end of file
2.0.1
\ No newline at end of file
# This is a generated file; do not edit or check into version control.
flutter_keyboard_visibility=D:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\flutter_keyboard_visibility-5.0.0\\
flutter_keyboard_visibility_web=D:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\flutter_keyboard_visibility_web-2.0.0\\
flutter_plugin_android_lifecycle=D:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\flutter_plugin_android_lifecycle-2.0.1\\
flutter_secure_storage=D:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\flutter_secure_storage-3.3.5\\
image_picker=D:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\image_picker-0.7.4\\
image_picker_for_web=D:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\image_picker_for_web-2.0.0\\
path_provider=D:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider-2.0.1\\
path_provider_linux=D:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_linux-2.0.0\\
path_provider_macos=D:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_macos-2.0.0\\
path_provider_windows=D:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_windows-2.0.0\\
flutter_keyboard_visibility=C:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\flutter_keyboard_visibility-5.0.0\\
flutter_keyboard_visibility_web=C:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\flutter_keyboard_visibility_web-2.0.0\\
flutter_plugin_android_lifecycle=C:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\flutter_plugin_android_lifecycle-2.0.1\\
flutter_secure_storage=C:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\flutter_secure_storage-3.3.5\\
image_picker=C:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\image_picker-0.7.4\\
image_picker_for_web=C:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\image_picker_for_web-2.0.0\\
path_provider=C:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider-2.0.1\\
path_provider_linux=C:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_linux-2.0.0\\
path_provider_macos=C:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_macos-2.0.0\\
path_provider_windows=C:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_windows-2.0.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-05-17 13:46:12.898505","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":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility-5.0.0\\\\","dependencies":[]},{"name":"flutter_secure_storage","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-3.3.5\\\\","dependencies":[]},{"name":"image_picker","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker-0.7.4\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]}],"android":[{"name":"flutter_keyboard_visibility","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility-5.0.0\\\\","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_plugin_android_lifecycle-2.0.1\\\\","dependencies":[]},{"name":"flutter_secure_storage","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-3.3.5\\\\","dependencies":[]},{"name":"image_picker","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker-0.7.4\\\\","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"path_provider","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-2.0.0\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-2.0.0\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-2.0.0\\\\","dependencies":[]}],"web":[{"name":"flutter_keyboard_visibility_web","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility_web-2.0.0\\\\","dependencies":[]},{"name":"image_picker_for_web","path":"C:\\\\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-05-31 10:35:50.621617","version":"2.0.1"}
\ No newline at end of file
image: cirrusci/flutter:stable
image: cirrusci/flutter:2.0.6
stages:
- linter
......@@ -6,11 +6,6 @@ stages:
- sonar
- build_android
before_script:
- flutter pub get
- flutter clean
- flutter --version
lint:flutter:
stage: linter
script:
......
This diff is collapsed.
sdk.dir=D:\\Android\\Sdk
flutter.sdk=D:\\src\\flutter
sdk.dir=C:\\Users\\Acer\\AppData\\Local\\Android\\sdk
flutter.sdk=C:\\flutter\\flutter
=======
flutter.buildMode=debug
flutter.versionName=1.0.0
flutter.versionCode=1
\ No newline at end of file
flutter.versionCode=1
......@@ -2,8 +2,6 @@
// Generated file. Do not edit.
//
// clang-format off
#ifndef GeneratedPluginRegistrant_h
#define GeneratedPluginRegistrant_h
......
......@@ -2,8 +2,6 @@
// Generated file. Do not edit.
//
// clang-format off
#import "GeneratedPluginRegistrant.h"
#if __has_include(<flutter_keyboard_visibility/FlutterKeyboardVisibilityPlugin.h>)
......
import 'dart:convert';
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;
......@@ -18,31 +19,8 @@ class Api {
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var token = jsonData['token'];
await secureStorage.writeSecureData('token', token);
} else if (apiResult.statusCode == 400) {
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var jsonError = jsonData['errors'];
var jsonErrorMessage = jsonError[0]['message'];
switch (jsonErrorMessage) {
case 'invalid.credential':
{
throw Exception('Invalid Credential');
}
break;
case 'empty.email':
{
throw Exception('Email cannot be empty');
}
break;
case 'empty.password':
{
throw Exception('Password cannot be empty');
}
break;
}
} else {
throw Exception('Failed to Login');
}
return apiResult.statusCode;
}
Future<int> register(String email, String password) async {
......@@ -55,7 +33,11 @@ class Api {
'is_company': true
};
var jsonBody = jsonEncode(map);
var apiResult = await client.post(apiURL, body: jsonBody);
var headers = {'Content-type': 'application/json'};
var apiResult = await client.post(apiURL, headers: headers, body: jsonBody);
print(apiResult.reasonPhrase);
print(apiResult.statusCode);
print(apiResult.request);
return apiResult.statusCode;
}
......@@ -99,19 +81,15 @@ class Api {
}
Future patchMember(String name, int addressId, String phone) async {
var apiURL = Uri.parse(
'https://canary.fundex.id/api/v1.1/member');
var apiURL = Uri.parse('https://canary.fundex.id/api/v1.1/member');
var token = await secureStorage.readSecureData('accessToken');
final apiResult = await client.patch(apiURL,
headers: <String, String>{
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({
'name': name,
'address_id': addressId,
'phone': phone
}));
headers: <String, String>{
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode(
{'name': name, 'address_id': addressId, 'phone': phone}));
if (apiResult.statusCode == 200) {
print('Patch member berhasil');
print(apiResult.statusCode);
......@@ -126,19 +104,16 @@ class Api {
}
}
Future<String> gender(String gen) async {
var apiURL = Uri.parse(
'https://canary.fundex.id/api/v1.1/member-attribute');
Future gender(String gen) 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': 'gender',
'attribute_value': gen
}));
headers: <String, String>{
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({'attribute_name': 'gender', 'attribute_value': gen}));
if (apiResult.statusCode == 200) {
print('gender berhasil');
print(apiResult.statusCode);
......@@ -146,31 +121,29 @@ class Api {
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var idMemberAttributeGender = jsonData['id'];
await secureStorage.writeSecureData('idMemberAttributeGender', idMemberAttributeGender);
await secureStorage.writeSecureData(
'idMemberAttributeGender', idMemberAttributeGender.toString());
print(await secureStorage.readSecureData('idMemberAttributeGender'));
return 'Simpan Berhasil!';
} else {
print('gender ' + apiResult.statusCode.toString());
print(apiResult.reasonPhrase);
print(apiResult.request);
print(apiResult.body);
throw Exception('Gagal menyimpan..');
throw Exception('Gagal menyimpan gender');
}
}
Future birthdate(DateTime date) async {
var apiURL = Uri.parse(
'https://canary.fundex.id/api/v1.1/member-attribute');
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': 'birthdate',
'attribute_value': date
}));
headers: <String, String>{
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode(
{'attribute_name': 'birthdate', 'attribute_value': date}));
if (apiResult.statusCode == 200) {
print('birthdate berhasil');
print(apiResult.statusCode);
......@@ -178,7 +151,8 @@ class Api {
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var idMemberAttributeBirthdate = jsonData['id'];
await secureStorage.writeSecureData('idMemberAttributeBirthdate', idMemberAttributeBirthdate);
await secureStorage.writeSecureData(
'idMemberAttributeBirthdate', idMemberAttributeBirthdate);
print(await secureStorage.readSecureData('idMemberAttributeBirthdate'));
return 'Simpan Berhasil!';
} else {
......@@ -191,18 +165,16 @@ class Api {
}
Future birthplace(String nameCity) async {
var apiURL = Uri.parse(
'https://canary.fundex.id/api/v1.1/member-attribute');
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': 'birthplace',
'attribute_value': nameCity
}));
headers: <String, String>{
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode(
{'attribute_name': 'birthplace', 'attribute_value': nameCity}));
if (apiResult.statusCode == 200) {
print('birthplace berhasil');
print(apiResult.statusCode);
......@@ -210,7 +182,8 @@ class Api {
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var idMemberAttributeBirthplace = jsonData['id'];
await secureStorage.writeSecureData('idMemberAttributeBirthplace', idMemberAttributeBirthplace);
await secureStorage.writeSecureData(
'idMemberAttributeBirthplace', idMemberAttributeBirthplace);
print(await secureStorage.readSecureData('idMemberAttributeBirthplace'));
return 'Simpan Berhasil!';
} else {
......@@ -218,7 +191,7 @@ class Api {
print(apiResult.reasonPhrase);
print(apiResult.request);
print(apiResult.body);
throw Exception('Gagal menyimpan..');
throw Exception('Gagal menyimpan tempat lahir');
}
}
......@@ -245,7 +218,8 @@ class Api {
}
Future getRefCity() async {
final apiURL = Uri.parse('https://canary.fundex.id/api/v1.1/ref-cities?offset=&limit=');
final apiURL = Uri.parse(
'https://canary.fundex.id/api/v1.1/ref-cities?offset=&limit=');
var token = await secureStorage.readSecureData('accessToken');
var headers = {
'Content-type': 'application/json',
......@@ -271,7 +245,8 @@ class Api {
}
Future getRefState() async {
final apiURL = Uri.parse('https://canary.fundex.id/api/v1.1/ref-states?offset=&limit=');
final apiURL = Uri.parse(
'https://canary.fundex.id/api/v1.1/ref-states?offset=&limit=');
var token = await secureStorage.readSecureData('accessToken');
var headers = {
'Content-type': 'application/json',
......@@ -297,7 +272,8 @@ class Api {
}
Future getRefDistrict() async {
final apiURL = Uri.parse('https://canary.fundex.id/api/v1.1/ref-districts?offset=&limit=');
final apiURL = Uri.parse(
'https://canary.fundex.id/api/v1.1/ref-districts?offset=&limit=');
var token = await secureStorage.readSecureData('accessToken');
var headers = {
'Content-type': 'application/json',
......@@ -322,28 +298,22 @@ class Api {
}
}
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');
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');
var token = await secureStorage.readSecureData('accessToken');
final apiResult = await client.post(apiURL,
headers: <String, String>{
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode(<String, String>{
"address": address,
"district": district,
"city": city,
"province": province,
"country": "Indonesia",
"zip_code": zipCode
}));
headers: <String, String>{
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode(<String, String>{
"address": address,
"district": district,
"city": city,
"province": province,
"country": "Indonesia",
"zip_code": zipCode
}));
if (apiResult.statusCode == 200) {
// var jsonObject = json.decode(apiResult.body);
// var data = (jsonObject as Map<String, dynamic>)['data'];
......@@ -363,4 +333,200 @@ class Api {
throw Exception('Gagal menyimpan..');
}
}
Future forgetPassword(String email, int statusCode) async {
final apiURL =
Uri.parse('https://canary.fundex.id/api/v1.1/auth/forgot-password');
var body = jsonEncode({'email': email});
var headers = {'Content-type': 'application/json'};
var apiResult = await client.post(apiURL, headers: headers, body: body);
statusCode = apiResult.statusCode;
return (statusCode);
}
Future getMemberDocsId() async {
final apiURL = Uri.parse(
'https://canary.fundex.id/api/v1.1/member-attributes?attribute_name=agreement_doc_id&offset=&limit=&order_by=');
var token = await secureStorage.readSecureData('accessToken');
var headers = {
'Content-type': 'application/json',
'Authorization': 'Bearer $token',
};
var apiResult = await client.get(apiURL, headers: headers);
if (apiResult.statusCode == 200) {
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var memberAttributes =
(jsonData as Map<String, dynamic>)['member_attributes'];
var idMemberDocs = (memberAttributes as Map<String, dynamic>)['id'];
await secureStorage.writeSecureData('idMemberDocs', idMemberDocs);
print(await secureStorage.readSecureData('idMemberDocs'));
} else {
throw Exception('Failed to get MemberDocsID');
}
}
Future getMemberDocs(String memberDocsId) async {
final apiURL = Uri.parse(
'https://canary.fundex.id/api/v1.1/member-documents/$memberDocsId/private');
var token = await secureStorage.readSecureData('accessToken');
var headers = {
'Content-type': 'application/json',
'Authorization': 'Bearer $token',
};
var apiResult = await client.get(apiURL, headers: headers);
if (apiResult.statusCode == 200) {
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var memberDocument =
(jsonData as Map<String, dynamic>)['member_document'];
var description = (memberDocument as Map<String, dynamic>)['description'];
var download = (description as Map<String, dynamic>)['download'];
var expiredAt = (download as Map<String, dynamic>)['expiredAt'];
var name = (memberDocument as Map<String, dynamic>)['name'];
var imgUrl = (memberDocument as Map<String, dynamic>)['url'];
await secureStorage.writeSecureData('memberDocs-expiredAt', expiredAt);
await secureStorage.writeSecureData('memberDocs-name', name);
await secureStorage.writeSecureData('memberDocs-imgUrl', imgUrl);
print(await secureStorage.readSecureData('memberDocs-expiredAt'));
print(await secureStorage.readSecureData('memberDocs-name'));
print(await secureStorage.readSecureData('memberDocs-imgUrl'));
// ISI DESCRIPTION
// {
// "docToken": "bb5e12c77438f60da1f2ab6e566c5aeb6d03561bec3e5d588f7e240e4c164120",
// "recipients": [{
// "privyId": "AB1234",
// "type": "Reviewer",
// "signatoryStatus": "Completed"
// },
// {
// "privyId": "DE3456",
// "type": "Signer",
// "signatoryStatus": "Completed"
// }
// ],
// "documentStatus": "Completed",
// "urlDocument": "https://sign-sandbox.privy.id/doc/bb5e12c77438f60da1f2ab6e566c5aeb6d03561bec3e5d588f7e240e4c164120",
// "download": {
// "url": "http://api-sandbox.privy.id/document/6S7p0MVgdB-f9a360ab-6d47-41d8-881d-b4492bad49f8",
// "expiredAt": "2019-04-25T09:33:58+00:00"
// }}
} else {
throw Exception('Failed to get MemberDocsID');
}
}
Future getEquityOfferingsByID(String iD) async {
final apiURL = Uri.parse(
'https://canary.fundex.id/api/v1.1/public/equity-offerings/$iD');
var headers = {'Content-type': 'application/json'};
var apiResult = await client.get(apiURL, headers: headers);
if (apiResult.statusCode == 200) {
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var equityOffering = jsonData['equity_offering'];
return equityOffering;
}
}
Future getEquityOfferingDocsByID(String iD) async {
final apiURL = Uri.parse(
'https://canary.fundex.id/api/v1.1/public/equity-offerings/$iD');
var headers = {'Content-type': 'application/json'};
var apiResult = await client.get(apiURL, headers: headers);
if (apiResult.statusCode == 200) {
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var equityOfferingDocs = jsonData['offering_docs'];
return equityOfferingDocs;
}
}
Future getEquityOfferingBannersByID(String iD) async {
final apiURL = Uri.parse(
'https://canary.fundex.id/api/v1.1/public/equity-offerings/$iD');
var headers = {'Content-type': 'application/json'};
var apiResult = await client.get(apiURL, headers: headers);
if (apiResult.statusCode == 200) {
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var equityOfferingBanners = jsonData['offering_banners'];
return equityOfferingBanners;
}
}
Future getEquityOfferingSummaryByID(String iD) async {
final apiURL = Uri.parse(
'https://canary.fundex.id/api/v1.1/public/equity-offerings/$iD/summary');
var headers = {'Content-type': 'application/json'};
var apiResult = await client.get(apiURL, headers: headers);
if (apiResult.statusCode == 200) {
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var equityOfferingsSummary = jsonData['summary'];
return equityOfferingsSummary;
}
}
Future getEquityOfferingDetailsByID(String iD) async {
final apiURL =
Uri.parse('https://canary.fundex.id/api/v1.1/public/equities/$iD');
var headers = {'Content-type': 'application/json'};
var apiResult = await client.get(apiURL, headers: headers);
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var equityOfferingDetails = jsonData['equity'];
return equityOfferingDetails;
}
Future<EquityOfferings> getSortedEquities(
String statusOffering, String businessField, String sortBy) async {
final apiURL = Uri.parse(
'https://canary.fundex.id/api/v1.1/public/equity-offerings/explore?status_offering=' +
statusOffering +
'&business_field=' +
businessField +
'&sort_by=' +
sortBy);
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 equities: " + (apiResult.statusCode).toString());
if (apiResult.statusCode == 200) {
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
return EquityOfferings.fromJson(jsonData);
} else {
throw Exception('Get Failed');
}
}
Future<EquityOfferings> getEquities() async {
final apiURL = Uri.parse(
'https://canary.fundex.id/api/v1.1/public/equity-offerings/explore?status_offering=&business_field=&sort_by=');
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 equities: " + (apiResult.statusCode).toString());
if (apiResult.statusCode == 200) {
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
return EquityOfferings.fromJson(jsonData);
} else {
throw Exception('Get Failed');
}
}
}
......@@ -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
......
......@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:fundex_app/my_flutter_app_icons.dart';
import 'package:fundex_app/pages/business/homekyc.dart';
import 'package:fundex_app/pages/profile/profile_base_page.dart';
import 'package:fundex_app/pages/transaction/DetailTransactionPembelian.dart';
import 'package:fundex_app/pages/transaction/Transaction.dart';
import 'package:google_fonts/google_fonts.dart';
class MainScreen extends StatefulWidget {
......@@ -16,7 +16,7 @@ class _MainScreenState extends State<MainScreen> {
List<Widget> _widgetOptions = <Widget>[
HomeKYC(),
HomeKYC(),
DetailTransactionPembelian(),
Transaction(),
HomeKYC(),
ProfilBasePage(),
];
......
import 'package:flutter/material.dart';
import 'package:fundex_app/pages/register/register.dart';