Fakultas Ilmu Komputer UI

Commit 6d74d892 authored by wibias fuad's avatar wibias fuad
Browse files

Merge branch 'pbi-21-all-agreement' into 'staging'

Pbi 21 all agreement

See merge request !46
parents ec2c522a 1bb85a51
Pipeline #78522 passed with stages
in 16 minutes and 39 seconds
This diff is collapsed.
This diff is collapsed.
2.0.1
\ No newline at end of file
2.0.3
\ No newline at end of file
# This is a generated file; do not edit or check into version control.
flutter_keyboard_visibility=/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_keyboard_visibility-5.0.0/
flutter_keyboard_visibility_web=/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_keyboard_visibility_web-2.0.0/
flutter_plugin_android_lifecycle=/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android_lifecycle-2.0.1/
flutter_secure_storage=/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.5/
image_picker=/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.7.4/
image_picker_for_web=/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker_for_web-2.0.0/
path_provider=/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.1/
path_provider_linux=/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.0.0/
path_provider_macos=/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-2.0.0/
path_provider_windows=/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.0/
flutter_keyboard_visibility=C:\\flutter\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\flutter_keyboard_visibility-5.0.0\\
flutter_keyboard_visibility_web=C:\\flutter\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\flutter_keyboard_visibility_web-2.0.0\\
flutter_plugin_android_lifecycle=C:\\flutter\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\flutter_plugin_android_lifecycle-2.0.1\\
flutter_secure_storage=C:\\flutter\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\flutter_secure_storage-3.3.5\\
image_picker=C:\\flutter\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\image_picker-0.7.4\\
image_picker_for_web=C:\\flutter\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\image_picker_for_web-2.0.0\\
path_provider=C:\\flutter\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider-2.0.1\\
path_provider_linux=C:\\flutter\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_linux-2.0.0\\
path_provider_macos=C:\\flutter\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_macos-2.0.0\\
path_provider_windows=C:\\flutter\\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":"/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-21 21:49:47.804156","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:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility-5.0.0\\\\","dependencies":[]},{"name":"flutter_secure_storage","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-3.3.5\\\\","dependencies":[]},{"name":"image_picker","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker-0.7.4\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]}],"android":[{"name":"flutter_keyboard_visibility","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility-5.0.0\\\\","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_plugin_android_lifecycle-2.0.1\\\\","dependencies":[]},{"name":"flutter_secure_storage","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-3.3.5\\\\","dependencies":[]},{"name":"image_picker","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker-0.7.4\\\\","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"path_provider","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-2.0.0\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-2.0.0\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-2.0.0\\\\","dependencies":[]}],"web":[{"name":"flutter_keyboard_visibility_web","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility_web-2.0.0\\\\","dependencies":[]},{"name":"image_picker_for_web","path":"C:\\\\flutter\\\\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-24 04:16:34.088508","version":"2.0.3"}
\ No newline at end of file
This diff is collapsed.
sdk.dir=/Users/ferdisungkar/Library/Android/sdk
flutter.sdk=/Users/ferdisungkar/flutter
sdk.dir=C:\\Users\\Acer\\AppData\\Local\\Android\\sdk
flutter.sdk=C:\\flutter\\flutter
=======
flutter.buildMode=debug
flutter.versionName=1.0.0
......
// 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_ROOT=C:\flutter\flutter
FLUTTER_APPLICATION_PATH=E:\Fasilkom\Semester 6\Proyek Perangkat Lunak\all-agreement\ppl2021-d-slhape
FLUTTER_TARGET=lib\main.dart
FLUTTER_BUILD_DIR=build
SYMROOT=${SOURCE_ROOT}/../build/ios
SYMROOT=${SOURCE_ROOT}/../build\ios
FLUTTER_BUILD_NAME=1.0.0
FLUTTER_BUILD_NUMBER=1
DART_OBFUSCATION=false
......
#!/bin/sh
# 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_ROOT=C:\flutter\flutter"
export "FLUTTER_APPLICATION_PATH=E:\Fasilkom\Semester 6\Proyek Perangkat Lunak\all-agreement\ppl2021-d-slhape"
export "FLUTTER_TARGET=lib\main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "SYMROOT=${SOURCE_ROOT}/../build\ios"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_OBFUSCATION=false"
......
......@@ -99,19 +99,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);
......@@ -127,18 +123,15 @@ class Api {
}
Future<String> gender(String gen) 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': '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,7 +139,8 @@ 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);
print(await secureStorage.readSecureData('idMemberAttributeGender'));
return 'Simpan Berhasil!';
} else {
......@@ -159,18 +153,16 @@ class Api {
}
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 +170,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 +184,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 +201,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 {
......@@ -245,7 +237,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 +264,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 +291,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 +317,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 +352,77 @@ class Api {
throw Exception('Gagal menyimpan..');
}
}
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');
}
}
}
import 'package:flutter/material.dart';
import 'package:fundex_app/api/api.dart';
import 'package:fundex_app/assets/colors.dart';
import 'package:fundex_app/my_flutter_app_icons.dart';
import 'package:fundex_app/pages/profile/all_agreement.dart';
......@@ -20,7 +21,7 @@ class _AkunState extends State<Akun> {
//
String userName;
String userRole;
String userProfilePic;
String userProfilePic = 'https://picsum.photos/250?image=9';
@override
void initState() {
......@@ -29,8 +30,10 @@ class _AkunState extends State<Akun> {
}
Future init() async {
final userName = await SecureStorage().readSecureData('userName') ?? '';
final userRole = await SecureStorage().readSecureData('userRole') ?? '';
final userName =
await SecureStorage().readSecureData('userName') ?? 'username';
final userRole =
await SecureStorage().readSecureData('userRole') ?? 'userrole';
var userProfilePic =
await SecureStorage().readSecureData('userProfilePic') ?? '';
setState(() {
......@@ -42,9 +45,16 @@ class _AkunState extends State<Akun> {
Widget buildImage() {
if (userProfilePic == '') {
return Image.network('https://picsum.photos/250?image=9');
return Icon(
Icons.account_circle,
size: 48,
);
} else {
return Image.network(userProfilePic);
return Image.network(
userProfilePic ?? '',
height: 48,
width: 48,
);
}
}
......@@ -99,6 +109,7 @@ class _AkunState extends State<Akun> {
Container(
margin: EdgeInsets.fromLTRB(16, 0, 0, 0),
child: ClipRRect(
key: Key('userPhoto'),
borderRadius: BorderRadius.circular(90),
child: buildImage(),
),
......@@ -114,7 +125,7 @@ class _AkunState extends State<Akun> {
Container(
padding: EdgeInsets.fromLTRB(0, 0, 0, 0),
child: Text(
userName,
userName ?? '',
key: Key('usernameText'),
style: TextStyle(
fontWeight: FontWeight.bold,
......@@ -126,7 +137,7 @@ class _AkunState extends State<Akun> {
Container(
padding: EdgeInsets.fromLTRB(0, 0, 0, 0),
child: Text(
userRole,
userRole ?? '',
key: Key('usertypeText'),
style: TextStyle(
fontWeight: FontWeight.bold,
......@@ -214,7 +225,10 @@ class _AkunState extends State<Akun> {
flex: 40,
child: Material(
child: InkWell(
onTap: () {
onTap: () async {
Api().getMemberDocsId();
Api().getMemberDocs(
await SecureStorage().readSecureData('idMemberDocs'));
Navigator.push(
context,
MaterialPageRoute(
......
This diff is collapsed.
This diff is collapsed.
// import 'package:flutter/material.dart';
// import 'package:flutter_test/flutter_test.dart';
// import 'package:fundex_app/pages/profile/all_agreement.dart';
// void main() {
// Widget createWidgetForTesting({Widget child}) {
// return MaterialApp(
// home: child,
// );
// }
// testWidgets('Testing Scaffold', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('scaffold')), findsOneWidget);
// });
// testWidgets('Testing appbar', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('appbar')), findsOneWidget);
// });
// testWidgets('Testing icon back', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('icon-back')), findsOneWidget);
// });
// testWidgets('Testing text perjanjian', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('text-perjanjian')), findsOneWidget);
// });
// testWidgets('Testing body', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('body')), findsOneWidget);
// });
// testWidgets('Testing margin container 0', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('marginContainer-0')), findsOneWidget);
// });
// testWidgets('Testing tabbar', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('tabbar')), findsOneWidget);
// });
// testWidgets('Testing tab semua', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('tab-semua')), findsOneWidget);
// });
// testWidgets('Testing tab perlu tanda tangan', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('tab-perluTandaTangan')), findsOneWidget);
// });
// testWidgets('Testing tabbar view', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('tabbar-view')), findsOneWidget);
// });
// testWidgets('Testing content tabbar semua', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('content-tabbar-semua')), findsOneWidget);
// });
// testWidgets('Testing Card Semua', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('card-semua')), findsWidgets);
// });
// }
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:fundex_app/main-screen.dart';
import 'package:fundex_app/pages/profile/all_agreement.dart';
void main() {
Widget createWidgetForTesting({Widget child}) {
......@@ -81,39 +9,53 @@ void main() {
);
}
testWidgets('Testing bottom navigation bar', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: MainScreen()));
expect(find.byKey(Key('bottomNavigationBar')), findsOneWidget);
testWidgets('Testing Scaffold', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
expect(find.byKey(Key('scaffold')), findsOneWidget);
});
testWidgets('Testing home icon on bottom navbar',
(WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: MainScreen()));
expect(find.byKey(Key('homeIcon')), findsOneWidget);
testWidgets('Testing appbar', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
expect(find.byKey(Key('appbar')), findsOneWidget);
});
testWidgets('Testing portfolio icon on bottom navbar',
(WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: MainScreen()));
expect(find.byKey(Key('portfolioIcon')), findsOneWidget);
testWidgets('Testing icon back', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
expect(find.byKey(Key('icon-back')), findsOneWidget);
});
testWidgets('Testing transaction icon on bottom navbar',
(WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: MainScreen()));
expect(find.byKey(Key('transactionIcon')), findsOneWidget);
testWidgets('Testing text perjanjian', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
expect(find.byKey(Key('text-perjanjian')), findsOneWidget);
});
testWidgets('Testing help icon on bottom navbar',
(WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: MainScreen()));
expect(find.byKey(Key('helpIcon')), findsOneWidget);
testWidgets('Testing body', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
expect(find.byKey(Key('body')), findsOneWidget);
});
testWidgets('Testing account icon on bottom navbar',
(WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: MainScreen()));
expect(find.byKey(Key('accountIcon')), findsOneWidget);
testWidgets('Testing margin container 0', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
expect(find.byKey(Key('marginContainer-0')), findsOneWidget);
});
}
testWidgets('Testing tabbar', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
expect(find.byKey(Key('tabbar')), findsOneWidget);
});
testWidgets('Testing tab semua', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));