Fakultas Ilmu Komputer UI

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

[REFACTOR] pulling from staging and edited code in data identitas

parents dc77cca8 692ea91e
Pipeline #75664 passed with stages
in 7 minutes and 8 seconds
......@@ -662,7 +662,7 @@
"languageVersion": "2.7"
}
],
"generated": "2021-05-02T23:27:01.740632Z",
"generated": "2021-05-08T11:07:21.715200Z",
"generator": "pub",
"generatorVersion": "2.13.0-116.0.dev"
}
{"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-03 06:27:03.658413","version":"2.1.0-12.1.pre"}
\ No newline at end of file
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_keyboard_visibility","path":"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-08 18:14:14.906538","version":"2.1.0-12.1.pre"}
\ No newline at end of file
......@@ -4,7 +4,7 @@ stages:
- linter
- test_coverage
- sonar
- build_android
# - build_android
before_script:
- flutter pub get
......@@ -64,16 +64,16 @@ SonarScanner:
- staging
build_android:
stage: build_android
before_script:
- flutter packages get
- flutter clean
script:
- flutter build apk
artifacts:
paths:
- build/app/outputs/apk/release/app-release.apk
only:
- master
- staging
# build_android:
# stage: build_android
# before_script:
# - flutter packages get
# - flutter clean
# script:
# - flutter build apk
# artifacts:
# paths:
# - build/app/outputs/apk/release/app-release.apk
# only:
# - master
# - staging
......@@ -3,7 +3,7 @@
#
# For more info see: https://dart.dev/go/dot-packages-deprecation
#
# Generated by pub on 2021-05-03 06:27:01.583389.
# Generated by pub on 2021-05-08 18:07:21.617463.
_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/
args:file:///D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/args-2.0.0/lib/
......
sdk.dir=D:\\Android\\Sdk
flutter.sdk=D:\\src\\flutter
=======
flutter.buildMode=release
flutter.buildMode=debug
flutter.versionName=1.0.0
flutter.versionCode=1
\ No newline at end of file
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=C:\flutter\flutter
FLUTTER_APPLICATION_PATH=E:\Fasilkom\Semester 6\Proyek Perangkat Lunak\integrate-to-github\ppl2021-d-slhape
FLUTTER_TARGET=lib\main.dart
FLUTTER_ROOT=/Users/ferdisungkar/flutter
FLUTTER_APPLICATION_PATH=/Users/ferdisungkar/Desktop/Files/Universitas-Indonesia/Semester-6/PPL/Project/ppl2021-d-slhape
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
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
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=C:\flutter\flutter"
export "FLUTTER_APPLICATION_PATH=E:\Fasilkom\Semester 6\Proyek Perangkat Lunak\integrate-to-github\ppl2021-d-slhape"
export "FLUTTER_TARGET=lib\main.dart"
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=/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 "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"
......@@ -12,12 +12,10 @@ class Api {
var body = jsonEncode({'email': email, 'password': password});
var headers = {'Content-type': 'application/json'};
var apiResult = await client.post(apiURL, headers: headers, body: body);
print(apiResult.statusCode);
if (apiResult.statusCode == 200) {
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var token = jsonData['token'];
print(token);
await secureStorage.writeSecureData('token', token);
} else if (apiResult.statusCode == 400) {
var jsonObject = json.decode(apiResult.body);
......@@ -59,4 +57,31 @@ class Api {
var apiResult = await client.post(apiURL, body: jsonBody);
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");
}
}
}
......@@ -456,6 +456,7 @@ class _DataIdentitasState extends State<DataIdentitas> {
onPressed: () {
if (!_formkey.currentState.validate()) {
print("Failed");
return;
}
Navigator.push(context,
MaterialPageRoute(builder: (context) {
......
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:fundex_app/main-screen.dart';
import 'package:fundex_app/api/api.dart';
import 'package:fundex_app/pages/forget-password/ForgetPassword.dart';
import 'package:fundex_app/pages/payment/CancelConfirmation.dart';
import 'package:fundex_app/pages/register/register.dart';
import 'package:fundex_app/storage/storage.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:fundex_app/assets/colors.dart';
......@@ -193,22 +194,25 @@ class _LoginState extends State<Login> {
height: 52,
child: ElevatedButton(
key: Key('loginButton'),
onPressed: () {
onPressed: () async {
if (!_keyForm.currentState
.validate()) {
return;
}
_keyForm.currentState.save();
print(email);
print(password);
Api().login(email, password);
Api().otpGet(
await SecureStorage()
.readSecureData(
'token'));
Navigator.push(context,
MaterialPageRoute(
builder: (context) {
return MaterialApp(
home: MainScreen());
home:
CancelConfirmation());
}));
},
child: Text(
......
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';
......@@ -283,9 +285,12 @@ class __OtpFormState extends State<_OtpForm> {
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
borderSide: BorderSide(color: gray4))),
onChanged: (value) {
onChanged: (value) async {
String stringValue = value.toString();
otpString = otpString + stringValue;
pin6FocusNode.unfocus();
otp = int.parse(otpString);
Api().otpInput(
await SecureStorage().readSecureData('token'), otpString);
Navigator.push(context, MaterialPageRoute(builder: (context) {
return MaterialApp(home: MainScreen());
}));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment