Fakultas Ilmu Komputer UI

Commit e70e5672 authored by Muhammad Farhan Ghaffar's avatar Muhammad Farhan Ghaffar
Browse files

[REFACTOR] adding API and adding code for alamat biodata

parent ea93ae05
Pipeline #77227 failed with stages
in 6 minutes and 39 seconds
...@@ -662,7 +662,7 @@ ...@@ -662,7 +662,7 @@
"languageVersion": "2.7" "languageVersion": "2.7"
} }
], ],
"generated": "2021-04-25T22:21:22.660340Z", "generated": "2021-05-16T19:59:09.467344Z",
"generator": "pub", "generator": "pub",
"generatorVersion": "2.13.0-116.0.dev" "generatorVersion": "2.13.0-116.0.dev"
} }
fundex_app fundex_app
2.7 2.7
file:///D:/farhan/ppl/paling%20baru/ppl2021-d-slhape/ file:///D:/farhan/ppl/New%20folder%20(2)/ppl2021-d-slhape/
file:///D:/farhan/ppl/paling%20baru/ppl2021-d-slhape/lib/ file:///D:/farhan/ppl/New%20folder%20(2)/ppl2021-d-slhape/lib/
_fe_analyzer_shared _fe_analyzer_shared
2.2 2.2
file:///D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/_fe_analyzer_shared-14.0.0/ file:///D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/_fe_analyzer_shared-14.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-04-26 05:21:23.045245","version":"2.1.0-12.1.pre"} {"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 02:59:10.531607","version":"2.1.0-12.1.pre"}
\ No newline at end of file \ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# #
# For more info see: https://dart.dev/go/dot-packages-deprecation # For more info see: https://dart.dev/go/dot-packages-deprecation
# #
# Generated by pub on 2021-04-26 05:21:22.627327. # Generated by pub on 2021-05-17 02:59:09.363471.
_fe_analyzer_shared:file:///D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/_fe_analyzer_shared-14.0.0/lib/ _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/ 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/ args:file:///D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/args-2.0.0/lib/
......
import 'dart:convert'; import 'dart:convert';
import 'dart:io';
import 'package:fundex_app/storage/storage.dart'; import 'package:fundex_app/storage/storage.dart';
import 'package:http/http.dart' show Client; import 'package:http/http.dart' show Client;
...@@ -58,4 +59,297 @@ class Api { ...@@ -58,4 +59,297 @@ class Api {
var apiResult = await client.post(apiURL, body: jsonBody); var apiResult = await client.post(apiURL, body: jsonBody);
return apiResult.statusCode; return apiResult.statusCode;
} }
Future otpGet(String token) async {
var apiURL =
Uri.parse('https://canary.fundex.id/api/v1.1/auth/otp-login-request');
var body = jsonEncode({'token': token});
var headers = {'Content-type': 'application/json'};
await client.post(apiURL, headers: headers, body: body);
}
Future otpInput(String token, String otp) async {
var apiURL = Uri.parse('https://canary.fundex.id/api/v1.1/auth/verify');
var body = jsonEncode({'token': token, 'otp': otp});
var headers = {'Content-type': 'application/json'};
var apiResult = await client.post(apiURL, headers: headers, body: body);
if (apiResult.statusCode == 200) {
print('pinter');
var jsonObject = json.decode(apiResult.body);
var accessToken = (jsonObject as Map<String, dynamic>)['access_token'];
//var jsonData = (jsonObject as Map<String, dynamic>)['data'];
await secureStorage.writeSecureData('accessToken', accessToken);
print(await secureStorage.readSecureData('accessToken'));
} else if (apiResult.statusCode == 400) {
print("Failed");
} else {
print("Unknown");
}
}
Future patchMember(String name, int addressId, String phone) async {
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
}));
if (apiResult.statusCode == 200) {
print('Patch member berhasil');
print(apiResult.statusCode);
print(apiResult.body);
return 'Simpan Berhasil!';
} else {
print('Patch member ' + apiResult.statusCode.toString());
print(apiResult.reasonPhrase);
print(apiResult.request);
print(apiResult.body);
throw Exception('Gagal menyimpan..');
}
}
Future<String> 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'
}));
if (apiResult.statusCode == 200) {
print('gender berhasil');
print(apiResult.statusCode);
print(apiResult.body);
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var idMemberAttributeGender = jsonData['id'];
await secureStorage.writeSecureData('idMemberAttributeGender', idMemberAttributeGender);
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..');
}
}
Future birthdate(DateTime date) 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': 'birthdate',
'attribute_value': date
}));
if (apiResult.statusCode == 200) {
print('birthdate berhasil');
print(apiResult.statusCode);
print(apiResult.body);
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var idMemberAttributeBirthdate = jsonData['id'];
await secureStorage.writeSecureData('idMemberAttributeBirthdate', idMemberAttributeBirthdate);
print(await secureStorage.readSecureData('idMemberAttributeBirthdate'));
return 'Simpan Berhasil!';
} else {
print('birthdate ' + apiResult.statusCode.toString());
print(apiResult.reasonPhrase);
print(apiResult.request);
print(apiResult.body);
throw Exception('Gagal menyimpan..');
}
}
Future birthplace(String nameCity) 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': 'birthplace',
'attribute_value': nameCity
}));
if (apiResult.statusCode == 200) {
print('birthplace berhasil');
print(apiResult.statusCode);
print(apiResult.body);
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var idMemberAttributeBirthplace = jsonData['id'];
await secureStorage.writeSecureData('idMemberAttributeBirthplace', idMemberAttributeBirthplace);
print(await secureStorage.readSecureData('idMemberAttributeBirthplace'));
return 'Simpan Berhasil!';
} else {
print('birthplace ' + apiResult.statusCode.toString());
print(apiResult.reasonPhrase);
print(apiResult.request);
print(apiResult.body);
throw Exception('Gagal menyimpan..');
}
}
Future getMember() async {
final apiURL = Uri.parse('https://canary.fundex.id/api/v1.1/member');
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 member: " + (apiResult.statusCode).toString());
if (apiResult.statusCode == 200) {
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var jsonMember = (jsonData as Map<String, dynamic>)['member'];
return jsonMember;
} else {
throw Exception('Get Failed');
}
}
Future getRefCity() async {
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',
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 ref cities: " + (apiResult.statusCode).toString());
if (apiResult.statusCode == 200) {
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
List<dynamic> refCities = jsonData['ref_cities'];
final List<String> city = <String>[];
for (var i = 0; i < refCities.length; i++) {
city.add(refCities[i]['name']);
}
return city;
} else {
throw Exception('Get Failed');
}
}
Future getRefState() async {
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',
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 ref state: " + (apiResult.statusCode).toString());
if (apiResult.statusCode == 200) {
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
List<dynamic> refCities = jsonData['ref_states'];
final List<String> state = <String>[];
for (var i = 0; i < refCities.length; i++) {
state.add(refCities[i]['name']);
}
return state;
} else {
throw Exception('Get Failed');
}
}
Future getRefDistrict() async {
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',
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 ref state: " + (apiResult.statusCode).toString());
if (apiResult.statusCode == 200) {
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
List<dynamic> refCities = jsonData['ref_districts'];
final List<String> distr = <String>[];
for (var i = 0; i < refCities.length; i++) {
distr.add(refCities[i]['name']);
}
return distr;
} else {
throw Exception('Get Failed');
}
}
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
}));
if (apiResult.statusCode == 200) {
// var jsonObject = json.decode(apiResult.body);
// var data = (jsonObject as Map<String, dynamic>)['data'];
// var name = data['name'];
// Map<String, dynamic> map = {'name': name};
print('Patch member berhasil');
print(apiResult.statusCode);
print(apiResult.reasonPhrase);
print(apiResult.request);
print(apiResult.body);
return 'Simpan Berhasil!';
} else {
print(apiResult.statusCode);
print(apiResult.reasonPhrase);
print(apiResult.request);
print(apiResult.body);
throw Exception('Gagal menyimpan..');
}
}
} }
...@@ -25,3 +25,8 @@ const gray5 = Color.fromRGBO(224, 224, 224, 1.0); ...@@ -25,3 +25,8 @@ const gray5 = Color.fromRGBO(224, 224, 224, 1.0);
// Element Colors // Element Colors
const red1 = Color.fromRGBO(159, 25, 25, 1.0); const red1 = Color.fromRGBO(159, 25, 25, 1.0);
const info = Color.fromRGBO(151, 182, 255, 1.0); const info = Color.fromRGBO(151, 182, 255, 1.0);
// Color for Akun
const background = Color.fromRGBO(242, 242, 242, 1.0);
const subtitle = Color.fromRGBO(91, 94, 109, 1.0);
const profil = Color.fromRGBO(46, 47, 48, 1.0);
\ No newline at end of file
import 'package:flutter/material.dart';
const primary = Color(0xFF12284B);
const secondary = Color(0xFF0091C9);
const white = Color(0xFFFFFFFF);
const black1 = Color(0xFF000000);
const gray4 = Color(0xFFBDBDBD);
\ No newline at end of file
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/akun.dart';
import 'package:fundex_app/pages/transaction/DetailTransactionPembelian.dart';
import 'package:google_fonts/google_fonts.dart';
class MainScreen extends StatefulWidget {
@override
_MainScreenState createState() => _MainScreenState();
}
class _MainScreenState extends State<MainScreen> {
int _selectedIndex = 0;
List<Widget> _widgetOptions = <Widget>[
HomeKYC(),
HomeKYC(),
DetailTransactionPembelian(),
HomeKYC(),
Akun(),
];
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
bottomNavigationBar: BottomNavigationBar(
currentIndex: _selectedIndex,
key: Key('bottomNavigationBar'),
backgroundColor: Colors.white,
selectedLabelStyle: GoogleFonts.inter(
fontWeight: FontWeight.bold,
fontSize: 12.0,
color: Color.fromRGBO(18, 40, 75, 1.0),
),
unselectedLabelStyle: GoogleFonts.inter(
fontWeight: FontWeight.bold,
fontSize: 12.0,
color: Color.fromRGBO(196, 196, 196, 1.0),
),
selectedItemColor: Color.fromRGBO(18, 40, 75, 1.0),
unselectedItemColor: Color.fromRGBO(196, 196, 196, 1.0),
type: BottomNavigationBarType.fixed,
items: [
BottomNavigationBarItem(
icon: Icon(
MyFlutterApp.selectedhomeicon,
key: Key('homeIcon'),
),
label: 'Beranda',
),
BottomNavigationBarItem(
icon: Icon(
MyFlutterApp.unselectedportfolio,
key: Key('portfolioIcon'),
),
label: 'Portfolio',
),
BottomNavigationBarItem(
icon: Icon(
MyFlutterApp.unselectedtransaction,
key: Key('transactionIcon'),
),
label: 'Transaksi',
),
BottomNavigationBarItem(
icon: Icon(
MyFlutterApp.unselectedhelp,
key: Key('helpIcon'),
),
label: 'Bantuan',
),
BottomNavigationBarItem(
icon: Icon(
MyFlutterApp.unselectedaccount,
key: Key('accountIcon'),
),
label: 'Akun',
),
],
onTap: (index) {
setState(() {
_selectedIndex = index;
});
},
),
body: _widgetOptions.elementAt(_selectedIndex),
);
}
}
// To parse this JSON data, do
//
// final user = userFromJson(jsonString);
import 'dart:convert';
User userFromJson(String str) => User.fromJson(json.decode(str));
String userToJson(User data) => json.encode(data.toJson());
class User {
User({
this.email,
this.password,
this.role,
this.isCompany,
});
String email;
String password;
String role;
bool isCompany;
factory User.fromJson(Map<String, dynamic> json) => User(
email: json["email"],
password: json["password"],
role: json["role"],
isCompany: json["is_company"],
);
Map<String, dynamic> toJson() => {
"email": email,
"password": password,
"role": role,
"is_company": isCompany,
};
}
/// Flutter icons MyFlutterApp
/// Copyright (C) 2021 by original authors @ fluttericon.com, fontello.com
/// This font was generated by FlutterIcon.com, which is derived from Fontello.
///
/// To use this font, place it in your fonts/ directory and include the
/// following in your pubspec.yaml
///
/// flutter:
/// fonts:
/// - family: MyFlutterApp
/// fonts:
/// - asset: fonts/MyFlutterApp.ttf
///
///
///
import 'package:flutter/widgets.dart';
class MyFlutterApp {
MyFlutterApp._();
static const _kFontFam = 'MyFlutterApp';
static const _kFontPkg = null;
static const IconData logout = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData syarat_dan_ketentuan = IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData komunitas = IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData faq = IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData ganti_password = IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData aktivasi_2fa = IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData akun_bank = IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData perjanjian = IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData profil = IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData kebijakan_privasi = IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData selectedhomeicon = IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData unselectedaccount = IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData unselectedhelp = IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData unselectedportfolio = IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData unselectedtransaction = IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg);
}
import 'package:flutter/material.dart';
import 'package:fundex_app/assets/colors.dart';
import 'package:fundex_app/pages/login/Login.dart';
import 'package:google_fonts/google_fonts.dart';
class EmailSent extends StatefulWidget {
@override
_EmailSentState createState() => _EmailSentState();
}
class _EmailSentState extends State<EmailSent> {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: SafeArea(
child: Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Column(children: <Widget>[
Container(
margin: const EdgeInsets.fromLTRB(0, 48, 0, 0),
child: Image.asset(
'assets/images/fundex-logo.png',
key: Key('fundexLogo'),
width: 82,
height: 22,
),
),
Container(
margin: const EdgeInsets.fromLTRB(0, 48, 0, 0),
child: Text(
'Email Berhasil Dikirim',
key: Key('pageTitleText'),
style: GoogleFonts.inter(
fontSize: 18,
fontWeight: FontWeight.w600,
color: black3),
),
),
Container(
margin: const EdgeInsets.fromLTRB(0, 32, 0, 0),
child: Image.asset(
'assets/images/icon-register-success.png',