Fakultas Ilmu Komputer UI

Commit 5b9aac70 authored by Manuel Yoseph Ray's avatar Manuel Yoseph Ray
Browse files

[REFACTOR] menambahkan search bar

parents c95870ed 2ba83e47
......@@ -169,6 +169,18 @@
"packageUri": "lib/",
"languageVersion": "2.9"
},
{
"name": "dependencies",
"rootUri": "file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/dependencies-0.1.5",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "disposables",
"rootUri": "file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/disposables-0.1.2",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "dotted_border",
"rootUri": "file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/dotted_border-1.0.7",
......@@ -361,6 +373,12 @@
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "material_floating_search_bar",
"rootUri": "file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/material_floating_search_bar-0.3.4",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "meta",
"rootUri": "file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.3.0",
......@@ -493,6 +511,12 @@
"packageUri": "lib/",
"languageVersion": "2.7"
},
{
"name": "quiver",
"rootUri": "file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/quiver-2.1.5",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "shelf",
"rootUri": "file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/shelf-1.1.0",
......@@ -595,6 +619,12 @@
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "time_formatter",
"rootUri": "file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/time_formatter-1.0.0+5",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "timing",
"rootUri": "file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/timing-0.1.1+3",
......@@ -668,7 +698,7 @@
"languageVersion": "2.7"
}
],
"generated": "2021-05-23T11:51:14.324823Z",
"generated": "2021-05-30T23:13:49.607447Z",
"generator": "pub",
"generatorVersion": "2.12.0"
}
......@@ -114,6 +114,14 @@ dart_style
2.9
file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/dart_style-1.3.12/
file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/dart_style-1.3.12/lib/
dependencies
2.0
file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/dependencies-0.1.5/
file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/dependencies-0.1.5/lib/
disposables
2.0
file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/disposables-0.1.2/
file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/disposables-0.1.2/lib/
dotted_border
2.2
file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/dotted_border-1.0.7/
......@@ -230,6 +238,10 @@ matcher
2.12
file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.10/
file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.10/lib/
material_floating_search_bar
2.12
file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/material_floating_search_bar-0.3.4/
file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/material_floating_search_bar-0.3.4/lib/
meta
2.12
file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.3.0/
......@@ -318,6 +330,10 @@ pubspec_parse
2.7
file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/pubspec_parse-0.1.8/
file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/pubspec_parse-0.1.8/lib/
quiver
2.0
file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/quiver-2.1.5/
file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/quiver-2.1.5/lib/
shelf
2.12
file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/shelf-1.1.0/
......@@ -382,6 +398,10 @@ test_core
2.12
file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/test_core-0.3.15/
file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/test_core-0.3.15/lib/
time_formatter
2.0
file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/time_formatter-1.0.0+5/
file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/time_formatter-1.0.0+5/lib/
timing
2.2
file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/timing-0.1.1+3/
......
{"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-23 18:51:14.947822","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":"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 08:50:07.931272","version":"2.0.1"}
\ 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-05-23 18:51:14.259823.
# Generated by pub on 2021-05-31 06:13:49.587444.
_fe_analyzer_shared:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/_fe_analyzer_shared-14.0.0/lib/
analyzer:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-0.41.2/lib/
args:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/args-2.0.0/lib/
......@@ -32,6 +32,8 @@ crypto:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/crypto-3.0.0/li
csslib:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/csslib-0.17.0/lib/
cupertino_icons:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-1.0.2/lib/
dart_style:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/dart_style-1.3.12/lib/
dependencies:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/dependencies-0.1.5/lib/
disposables:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/disposables-0.1.2/lib/
dotted_border:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/dotted_border-1.0.7/lib/
fake_async:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/fake_async-1.2.0/lib/
ffi:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/ffi-1.0.0/lib/
......@@ -64,6 +66,7 @@ js:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.3/lib/
json_annotation:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/json_annotation-4.0.1/lib/
logging:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/logging-1.0.1/lib/
matcher:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.10/lib/
material_floating_search_bar:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/material_floating_search_bar-0.3.4/lib/
meta:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.3.0/lib/
mime:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/mime-1.0.0/lib/
mockito:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/mockito-4.1.4/lib/
......@@ -86,6 +89,7 @@ pool:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/pool-1.5.0/lib/
process:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/process-4.2.1/lib/
pub_semver:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/pub_semver-2.0.0/lib/
pubspec_parse:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/pubspec_parse-0.1.8/lib/
quiver:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/quiver-2.1.5/lib/
shelf:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/shelf-1.1.0/lib/
shelf_packages_handler:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/shelf_packages_handler-2.0.1/lib/
shelf_static:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/shelf_static-0.2.9+2/lib/
......@@ -103,6 +107,7 @@ term_glyph:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-
test:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/test-1.16.5/lib/
test_api:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.2.19/lib/
test_core:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/test_core-0.3.15/lib/
time_formatter:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/time_formatter-1.0.0+5/lib/
timing:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/timing-0.1.1+3/lib/
typed_data:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0/lib/
vector_math:file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.0/lib/
......
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=/Users/ferdisungkar/flutter
FLUTTER_APPLICATION_PATH=/Users/ferdisungkar/Desktop/Files/Universitas-Indonesia/Semester-6/PPL/Project/ppl2021-d-slhape
FLUTTER_TARGET=lib/main.dart
FLUTTER_TARGET=/Users/ferdisungkar/Desktop/Files/Universitas-Indonesia/Semester-6/PPL/Project/ppl2021-d-slhape/lib/main.dart
FLUTTER_BUILD_DIR=build
SYMROOT=${SOURCE_ROOT}/../build/ios
FLUTTER_BUILD_NAME=1.0.0
FLUTTER_BUILD_NUMBER=1
DART_DEFINES=flutter.inspector.structuredErrors%3Dtrue
DART_OBFUSCATION=false
TRACK_WIDGET_CREATION=false
TRACK_WIDGET_CREATION=true
TREE_SHAKE_ICONS=false
PACKAGE_CONFIG=.packages
PACKAGE_CONFIG=/Users/ferdisungkar/Desktop/Files/Universitas-Indonesia/Semester-6/PPL/Project/ppl2021-d-slhape/.dart_tool/package_config.json
......@@ -2,12 +2,13 @@
# This is a generated file; do not edit or check into version control.
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=lib/main.dart"
export "FLUTTER_TARGET=/Users/ferdisungkar/Desktop/Files/Universitas-Indonesia/Semester-6/PPL/Project/ppl2021-d-slhape/lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_DEFINES=flutter.inspector.structuredErrors%3Dtrue"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.packages"
export "PACKAGE_CONFIG=/Users/ferdisungkar/Desktop/Files/Universitas-Indonesia/Semester-6/PPL/Project/ppl2021-d-slhape/.dart_tool/package_config.json"
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 {
......@@ -126,7 +104,7 @@ class Api {
}
}
Future<String> gender(String gen) async {
Future gender(String gen) async {
var apiURL =
Uri.parse('https://canary.fundex.id/api/v1.1/member-attribute');
var token = await secureStorage.readSecureData('accessToken');
......@@ -144,15 +122,14 @@ class Api {
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var idMemberAttributeGender = jsonData['id'];
await secureStorage.writeSecureData(
'idMemberAttributeGender', idMemberAttributeGender);
'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');
}
}
......@@ -214,7 +191,7 @@ class Api {
print(apiResult.reasonPhrase);
print(apiResult.request);
print(apiResult.body);
throw Exception('Gagal menyimpan..');
throw Exception('Gagal menyimpan tempat lahir');
}
}
......@@ -356,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');
}
}
}
import 'package:flutter/material.dart';
import 'package:fundex_app/pages/register/register.dart';
import 'package:fundex_app/pages/transaction/Transaction.dart';
void main() {
runApp(MaterialApp(home: RegisterPage()));
runApp(MaterialApp(home: Transaction()));
}
class MyApp extends StatelessWidget {
......
import 'Ukm.dart';
class EquityOfferings {
List<Ukm> ukmList;
EquityOfferings({this.ukmList});
factory EquityOfferings.fromJson(Map<String, dynamic> jsonData) {
var list = jsonData['equity_offerings'] as List;
print(list.runtimeType);
List<Ukm> ukmLists = list.map((i) => Ukm.fromJson(i)).toList();
return EquityOfferings(ukmList: ukmLists);
}
List<Ukm> getUkmList() {
return this.ukmList;
}
}
import 'package:intl/intl.dart';
import 'package:time_formatter/time_formatter.dart';
class Ukm {
final String ukmName;
final String ukmCompanyName;
final String ukmLogo;
final String ukmPic;
String ukmStatus;
final String ukmBusinessField;
double fundTarget;
double unitPrice;
Duration remainingTime;
int minInvest;
int fundCollectedPercentage;
double fundCollected;
int investorSum;
Ukm(
this.ukmName,
this.ukmCompanyName,
this.ukmPic,
this.ukmLogo,
this.ukmStatus,
this.ukmBusinessField,
this.fundTarget,
this.unitPrice,
this.remainingTime,
this.minInvest,
this.fundCollectedPercentage,
this.fundCollected,
this.investorSum);
String get beautifyUnitPrice {
final currencyFormatter = NumberFormat.currency(locale: 'ID');
return currencyFormatter.format(this.unitPrice);
int id;
String bannerImg;
String equityName;
int remainingTime;
String descriptionId;
String descriptionEn;
String price;
String fundingTarget;
String minInvest;
int totalInvestor;
String totalRaised;
int statusOffering;
String progress;
String logoUrl;
Ukm({
this.id,
this.bannerImg,
this.equityName,
this.remainingTime,
this.descriptionId,
this.descriptionEn,
this.price,
this.fundingTarget,
this.minInvest,
this.totalInvestor,
this.totalRaised,
this.statusOffering,
this.progress,
this.logoUrl,
});
factory Ukm.fromJson(Map<String, dynamic> jsonData) {
return Ukm(
id: jsonData['id'],
bannerImg: jsonData['banner_img'],
equityName: jsonData['equity_name'],
remainingTime: jsonData['remaining_time'],
descriptionId: jsonData['description_id'],
descriptionEn: jsonData['description_en'],
price: jsonData['price'],
fundingTarget: jsonData['funding_target'],
minInvest: jsonData['min_invest'],
totalInvestor: jsonData['total_investor'],
totalRaised: jsonData['total_raised'],
statusOffering: jsonData['status_offering'],
progress: jsonData['progress'],
logoUrl: jsonData['logo_url']);
}
String get beautifyPrice {
final currencyFormatter = NumberFormat('#,##0.00', 'ID');
return "Rp " + currencyFormatter.format(int.parse(this.price));
}
String get beautifyMinInvest {
if (int.parse(this.minInvest) >= 1000000.00 &&
int.parse(this.minInvest)