Fakultas Ilmu Komputer UI

Commit 55a75602 authored by Ferdi Salim Sungkar's avatar Ferdi Salim Sungkar
Browse files

[GREEN] adding apis and connecting pages

parents 57cb4305 7c9d9837
......@@ -595,6 +595,12 @@
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "time_formatter",
"rootUri": "file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/time_formatter-1.0.0+5",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "timing",
"rootUri": "file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/timing-0.1.1+3",
......@@ -668,7 +674,7 @@
"languageVersion": "2.7"
}
],
"generated": "2021-05-30T08:50:09.184066Z",
"generated": "2021-05-30T20:09:45.741028Z",
"generator": "pub",
"generatorVersion": "2.12.0"
}
......@@ -382,6 +382,10 @@ test_core
2.12
file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/test_core-0.3.15/
file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/test_core-0.3.15/lib/
time_formatter
2.0
file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/time_formatter-1.0.0+5/
file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/time_formatter-1.0.0+5/lib/
timing
2.2
file:///Users/ferdisungkar/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":"/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 02:58:49.646797","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-05-31 03:12:30.421307","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-30 15:50:09.158599.
# Generated by pub on 2021-05-31 03:09:45.700399.
_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/
......@@ -103,6 +103,7 @@ term_glyph:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org
test:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/test-1.16.5/lib/
test_api:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.2.19/lib/
test_core:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/test_core-0.3.15/lib/
time_formatter:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/time_formatter-1.0.0+5/lib/
timing:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/timing-0.1.1+3/lib/
typed_data:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0/lib/
vector_math:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.0/lib/
......
import 'dart:convert';
import 'dart:io';
import 'dart:ui';
import 'package:fundex_app/pages/business/EquityOfferings.dart';
import 'package:fundex_app/storage/storage.dart';
import 'package:http/http.dart' show Client;
import 'package:flutter/material.dart';
class Api {
Client client = Client();
......@@ -476,4 +475,54 @@ class Api {
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/business/prospectus_page.dart';
import 'package:fundex_app/pages/register/register.dart';
void main() {
runApp(MaterialApp(home: ProspectusPage()));
runApp(MaterialApp(home: RegisterPage()));
}
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) < 999999999.99) {
double result = int.parse(this.minInvest) / 1000000;
return "Rp " + result.toInt().toString() + " Juta";
} else if (int.parse(this.minInvest) >= 1000000000.00 &&
int.parse(this.minInvest) < 999999999999.99) {
double result = int.parse(this.minInvest) / 1000000000;
return "Rp " + result.toInt().toString() + " Milyar";
} else {
final currencyFormatter = NumberFormat('#,##0.00', 'ID');
return "Rp " + currencyFormatter.format(double.parse(this.minInvest));
}
// final currencyFormatter = NumberFormat.currency(locale: 'ID');
// return currencyFormatter.format(this.minInvest);
}
String get beautifyProgress {
double progress = double.parse(this.progress);
double result = double.parse(progress.toStringAsFixed(2));
return result.toString();
}
String get beautifyFundTarget {
if (this.fundTarget >= 1000000.00 && this.fundTarget < 999999999.99) {
double result = this.fundTarget / 1000000;
return "IDR" + result.toInt().toString() + " Juta";
} else if (this.fundTarget >= 1000000000.00 &&
this.fundTarget < 999999999999.99) {
double result = this.fundTarget / 1000000000;
return "IDR" + result.toInt().toString() + " Milyar";
if (int.parse(this.fundingTarget) >= 1000000.00 &&
int.parse(this.fundingTarget) < 999999999.99) {
double result = int.parse(this.fundingTarget) / 1000000;
return "Rp " + result.toInt().toString() + " Juta";
} else if (int.parse(this.fundingTarget) >= 1000000000.00 &&
int.parse(this.fundingTarget) < 999999999999.99) {
double result = int.parse(this.fundingTarget) / 1000000000;
return "Rp " + result.toInt().toString() + " Milyar";
} else {
final currencyFormatter = NumberFormat('#,##0.00', 'ID');
return "Rp " + currencyFormatter.format(double.parse(this.fundingTarget));
}
final currencyFormatter = NumberFormat.currency(locale: 'ID');
return currencyFormatter.format(this.fundTarget);
}
String get beautifyDate {
var date = DateTime.fromMillisecondsSinceEpoch(this.remainingTime);
return DateFormat.yMMMd().format(date);
}
String get beautifyTime {
return formatTime(remainingTime);
}
}
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:fundex_app/pages/kyc/biodata_body.dart';
import 'package:google_fonts/google_fonts.dart';
Widget unregisteredUser(BuildContext context) {
return Container(
alignment: Alignment.center,
margin: EdgeInsets.all(16.0),
height: 150,
width: double.infinity,
key: Key('cardContainer'),
child: GestureDetector(
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (context) {
return MaterialApp(home: BiodataBody());
}));
},
child: Card(
key: Key('statusCard'),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
side: BorderSide(
color: Colors.grey.withOpacity(0.4),
width: 1,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
key: Key('rowStatusCard'),
children: <Widget>[
Expanded(
flex: 2,
child: Container(
height: double.infinity,
margin: EdgeInsets.all(16),
child: Image.asset(
'assets/images/unregisteredUser.png',
height: double.infinity,
width: double.infinity,
key: Key(
'statusLogo',
),
),
),
),
Expanded(
flex: 4,
child: Container(
margin: EdgeInsets.fromLTRB(0, 16, 16, 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Selamat Datang!',
key: Key('stringStatus'),
style: GoogleFonts.inter(
color: Color.fromRGBO(18, 40, 75, 1.0),
fontWeight: FontWeight.bold,
fontSize: 18.0),
),
SizedBox(
height: 4.0,
),
Text(
'Selesaikan pendaftaran e-KYC',
style: GoogleFonts.notoSans(
color: Color.fromRGBO(18, 40, 75, 1.0),
fontWeight: FontWeight.bold,
fontSize: 12.0),
),
Text(
'(Know Your Customer) untuk dapat memulai pengajuan dana',
style: GoogleFonts.notoSans(
color: Color.fromRGBO(18, 40, 75, 1.0),
fontWeight: FontWeight.w500,
fontSize: 12.0),
),
SizedBox(
key: Key(
'spaceBetweenFundTargetValueAndMinInvestString'),
height: 4.0,
),
Text(
'Ketuk kartu ini untuk menyelesaikan pendaftaran',
style: GoogleFonts.notoSans(
color: Color.fromRGBO(18, 40, 75, 1.0),
fontWeight: FontWeight.bold,
fontSize: 12.0),
),
]),
))
],
),
),
),
);
}
Widget waitingUser(BuildContext context) {
return Container(
alignment: Alignment.center,
margin: EdgeInsets.all(16.0),
key: Key('cardContainer'),
child: Card(
key: Key('statusCard'),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
side: BorderSide(
color: Colors.grey.withOpacity(0.4),
width: 1,
),
),
child: Padding(
key: Key('paddingStatusCard'),
padding: const EdgeInsets.fromLTRB(24.0, 32.0, 24.0, 32.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
key: Key('rowStatusCard'),
children: <Widget>[
Image.asset(
'assets/images/cardLogo.png',
key: Key('statusLogo'),
),
Text(
'Pendaftaran E-KYC berhasil \ndisetujui',
key: Key('stringStatus'),
style: GoogleFonts.inter(
color: Color.fromRGBO(18, 40, 75, 1.0),
fontWeight: FontWeight.bold,
fontSize: 14.0),
),
],
),
),
),
);
}
Widget registeredUser(BuildContext context) {
return Container(
alignment: Alignment.center,
margin: EdgeInsets.all(16.0),
height: 150,
width: double.infinity,
key: Key('cardContainer'),
child: Card(
key: Key('statusCard'),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
side: BorderSide(
color: Colors.grey.withOpacity(0.4),
width: 1,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
key: Key('rowStatusCard'),
children: <Widget>[
Expanded(
flex: 2,
child: Container(
height: double.infinity,
margin: EdgeInsets.all(16),
child: Image.asset(
'assets/images/registeredUser.png',
height: double.infinity,
width: double.infinity,
key: Key(
'statusLogo',
),
),
),
),
Expanded(
flex: 4,
child: Container(
margin: EdgeInsets.fromLTRB(0, 16, 16, 16),
child: Text(
'Pendaftaran E-KYC berhasil \ndisetujui',
key: Key('stringStatus'),
style: GoogleFonts.inter(
color: Color.fromRGBO(18, 40, 75, 1.0),
fontWeight: FontWeight.bold,
fontSize: 14.0),
),
))
],
),
),
);
}
Widget errorUser(BuildContext context) {
return Container(
alignment: Alignment.center,
margin: EdgeInsets.all(16.0),
key: Key('cardContainer'),
child: Card(
key: Key('statusCard'),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
side: BorderSide(
color: Colors.grey.withOpacity(0.4),
width: 1,
),
),
child: Padding(
key: Key('paddingStatusCard'),
padding: const EdgeInsets.fromLTRB(24.0, 32.0, 24.0, 32.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
key: Key('rowStatusCard'),
children: <Widget>[
Image.asset(
'assets/images/cardLogo.png',
key: Key('statusLogo'),
),
Text(
'Pendaftaran E-KYC berhasil \ndisetujui',
key: Key('stringStatus'),
style: GoogleFonts.inter(
color: Color.fromRGBO(18, 40, 75, 1.0),
fontWeight: FontWeight.bold,
fontSize: 14.0),
),
],
),
),
),
);
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -11,9 +11,12 @@ import 'package:percent_indicator/linear_percent_indicator.dart';
import 'homekyc.dart';
// ignore: must_be_immutable
class ProspectusPage extends StatefulWidget {
String prevId;
ProspectusPage(this.prevId);
@override
_ProspectusPageState createState() => _ProspectusPageState();
_ProspectusPageState createState() => _ProspectusPageState(prevId);
}
class _ProspectusPageState extends State<ProspectusPage> {
......@@ -32,6 +35,10 @@ class _ProspectusPageState extends State<ProspectusPage> {
List<Image> equityImages = [];
String name;
String code;
String prevId;
_ProspectusPageState(this.prevId);
@override
void initState() {
init();
......@@ -42,11 +49,11 @@ class _ProspectusPageState extends State<ProspectusPage> {
Future init() async {
final Map<String, dynamic> equityOffering =
await Api().getEquityOfferingsByID('43');
await Api().getEquityOfferingsByID(prevId);
final Map<String, dynamic> equityOfferingSummary =
await Api().getEquityOfferingSummaryByID('43');
await Api().getEquityOfferingSummaryByID(prevId);
final List<dynamic> equityOfferingBanners =
await Api().getEquityOfferingBannersByID('43');
await Api().getEquityOfferingBannersByID(prevId);
id = equityOffering['id'];
equityId = equityOffering['equity_id'];
if (int.parse(equityOffering['funding_target']) >= 1000000.00 &&
......
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';