Fakultas Ilmu Komputer UI

Commit a454bc5e authored by Ferdi Salim Sungkar's avatar Ferdi Salim Sungkar
Browse files

Merge branch '4-login' into 'staging'

merge '4-login' into 'staging'

See merge request !61
parents ec765b0f eb7030a3
Pipeline #83627 passed with stages
in 6 minutes and 39 seconds
This diff is collapsed.
This diff is collapsed.
2.0.3 2.0.1
\ No newline at end of file \ No newline at end of file
# This is a generated file; do not edit or check into version control. # This is a generated file; do not edit or check into version control.
flutter_keyboard_visibility=C:\\flutter\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\flutter_keyboard_visibility-5.0.0\\ flutter_keyboard_visibility=/Users/ferdisungkar/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_keyboard_visibility_web=/Users/ferdisungkar/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_plugin_android_lifecycle=/Users/ferdisungkar/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\\ flutter_secure_storage=/Users/ferdisungkar/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=/Users/ferdisungkar/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\\ image_picker_for_web=/Users/ferdisungkar/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=/Users/ferdisungkar/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_linux=/Users/ferdisungkar/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_macos=/Users/ferdisungkar/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\\ path_provider_windows=/Users/ferdisungkar/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":"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-06-09 20:03:50.030829","version":"2.0.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-06-27 00:11:21.899127","version":"2.0.1"}
\ No newline at end of file \ No newline at end of file
This diff is collapsed.
sdk.dir=C:\\Users\\Acer\\AppData\\Local\\Android\\sdk sdk.dir=/Users/ferdisungkar/Library/Android/sdk
flutter.sdk=C:\\flutter\\flutter flutter.sdk=/Users/ferdisungkar/flutter
======= =======
flutter.buildMode=debug flutter.buildMode=debug
flutter.versionName=1.0.0 flutter.versionName=1.0.0
......
// This is a generated file; do not edit or check into version control. // This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=C:\flutter\flutter FLUTTER_ROOT=/Users/ferdisungkar/flutter
FLUTTER_APPLICATION_PATH=E:\Fasilkom\Semester 6\Proyek Perangkat Lunak\biodata2\ppl2021-d-slhape 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 FLUTTER_BUILD_DIR=build
SYMROOT=${SOURCE_ROOT}/../build\ios SYMROOT=${SOURCE_ROOT}/../build/ios
FLUTTER_BUILD_NAME=1.0.0 FLUTTER_BUILD_NAME=1.0.0
FLUTTER_BUILD_NUMBER=1 FLUTTER_BUILD_NUMBER=1
DART_DEFINES=flutter.inspector.structuredErrors%3Dtrue
DART_OBFUSCATION=false DART_OBFUSCATION=false
TRACK_WIDGET_CREATION=false TRACK_WIDGET_CREATION=true
TREE_SHAKE_ICONS=false 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 #!/bin/sh
# This is a generated file; do not edit or check into version control. # This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=C:\flutter\flutter" export "FLUTTER_ROOT=/Users/ferdisungkar/flutter"
export "FLUTTER_APPLICATION_PATH=E:\Fasilkom\Semester 6\Proyek Perangkat Lunak\biodata2\ppl2021-d-slhape" 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 "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_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1" export "FLUTTER_BUILD_NUMBER=1"
export "DART_DEFINES=flutter.inspector.structuredErrors%3Dtrue"
export "DART_OBFUSCATION=false" export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=false" export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false" 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"
...@@ -48,8 +48,11 @@ class Api { ...@@ -48,8 +48,11 @@ class Api {
var body = jsonEncode({'token': token}); var body = jsonEncode({'token': token});
var headers = {'Content-type': 'application/json'}; var headers = {'Content-type': 'application/json'};
var apiResult = await client.post(apiURL, headers: headers, body: body); var apiResult = await client.post(apiURL, headers: headers, body: body);
print(apiResult.statusCode); var jsonObject = json.decode(apiResult.body);
print(apiResult.body); var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var duration =
((jsonData as Map<String, dynamic>)['otp_duration']).toString();
await secureStorage.writeSecureData('otpDuration', duration);
} }
Future otpInput(String token, String otp) async { Future otpInput(String token, String otp) async {
...@@ -58,11 +61,9 @@ class Api { ...@@ -58,11 +61,9 @@ class Api {
var headers = {'Content-type': 'application/json'}; var headers = {'Content-type': 'application/json'};
var apiResult = await client.post(apiURL, headers: headers, body: body); var apiResult = await client.post(apiURL, headers: headers, body: body);
if (apiResult.statusCode == 200) { if (apiResult.statusCode == 200) {
print('pinter');
var jsonObject = json.decode(apiResult.body); var jsonObject = json.decode(apiResult.body);
var accessToken = (jsonObject as Map<String, dynamic>)['access_token']; var accessToken = (jsonObject as Map<String, dynamic>)['access_token'];
await secureStorage.writeSecureData('accessToken', accessToken); await secureStorage.writeSecureData('accessToken', accessToken);
print(await secureStorage.readSecureData('accessToken'));
var jsonData = (jsonObject as Map<String, dynamic>)['data']; var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var userInfo = (jsonData as Map<String, dynamic>)['user_info']; var userInfo = (jsonData as Map<String, dynamic>)['user_info'];
var userName = (userInfo as Map<String, dynamic>)['name']; var userName = (userInfo as Map<String, dynamic>)['name'];
...@@ -76,11 +77,8 @@ class Api { ...@@ -76,11 +77,8 @@ class Api {
await secureStorage.writeSecureData('userProfilePic', userProfilePic); await secureStorage.writeSecureData('userProfilePic', userProfilePic);
print('userProfilePic: ' + print('userProfilePic: ' +
await secureStorage.readSecureData('userProfilePic')); await secureStorage.readSecureData('userProfilePic'));
} else if (apiResult.statusCode == 400) {
print("Failed");
} else {
print("Unknown");
} }
return (apiResult.statusCode);
} }
// API AAN ==================================================================================================== // API AAN ====================================================================================================
......
...@@ -2,7 +2,7 @@ import 'package:flutter/gestures.dart'; ...@@ -2,7 +2,7 @@ import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:fundex_app/api/api.dart'; import 'package:fundex_app/api/api.dart';
import 'package:fundex_app/pages/forget-password/ForgetPassword.dart'; import 'package:fundex_app/pages/forget-password/ForgetPassword.dart';
import 'package:fundex_app/pages/payment/CancelConfirmation.dart'; import 'package:fundex_app/pages/login/Otp.dart';
import 'package:fundex_app/pages/register/register.dart'; import 'package:fundex_app/pages/register/register.dart';
import 'package:fundex_app/storage/storage.dart'; import 'package:fundex_app/storage/storage.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
...@@ -248,8 +248,7 @@ class _LoginState extends State<Login> { ...@@ -248,8 +248,7 @@ class _LoginState extends State<Login> {
MaterialPageRoute( MaterialPageRoute(
builder: (context) { builder: (context) {
return MaterialApp( return MaterialApp(
home: home: Otp());
CancelConfirmation());
})); }));
} else if (statusCode == 400) { } else if (statusCode == 400) {
createAlertDialog(context); createAlertDialog(context);
......
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:fundex_app/api/api.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';
import '../business/homekycUnregsitered.dart';
class Otp extends StatefulWidget {
@override
_OtpState createState() => _OtpState();
}
class _OtpState extends State<Otp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
backgroundColor: white,
title: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
IconButton(
icon: Icon(
Icons.arrow_back,
color: primary,
),
onPressed: () {
Navigator.pop(context);
},
),
Text(
'Konfirmasi',
style: titleTextStyle(),
key: Key('appBarTitle'),
),
],
),
),
body: SafeArea(
child: Container(
margin: const EdgeInsets.fromLTRB(0, 56, 0, 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Column(
children: <Widget>[
Container(
child: Text(
'Masukan Kode OTP',
key: Key('pageTitle'),
style: GoogleFonts.inter(
fontSize: 16,
fontWeight: FontWeight.w400,
color: black1,
),
),
),
Container(
margin: const EdgeInsets.fromLTRB(0, 16, 0, 0),
child: Text(
'Kode OTP sudah dikirim melalui email',
key: Key('pageSubTitle'),
style: GoogleFonts.inter(
fontSize: 12,
fontWeight: FontWeight.w400,
color: black1,
),
),
),
Container(
width: 231,
margin: const EdgeInsets.fromLTRB(0, 16, 0, 0),
child: _OtpForm()),
Container(
margin: const EdgeInsets.fromLTRB(0, 32, 0, 0),
child: RichText(
text: TextSpan(
text: 'Kirim ulang OTP',
style: GoogleFonts.inter(
fontSize: 12,
fontWeight: FontWeight.normal,
color: Color.fromRGBO(0, 145, 201, 1.0)),
recognizer: TapGestureRecognizer()
..onTap = () async {
Api().otpGet(await SecureStorage()
.readSecureData('token'));
}),
key: Key('resendButton'),
),
)
],
)
],
),
),
),
),
);
}
}
class _OtpForm extends StatefulWidget {
@override
__OtpFormState createState() => __OtpFormState();
}
class __OtpFormState extends State<_OtpForm> {
var duration = 0;
void updateduration() async {
duration = int.parse(await SecureStorage().readSecureData('otpDuration'));
}
FocusNode pin2FocusNode;
FocusNode pin3FocusNode;
FocusNode pin4FocusNode;
FocusNode pin5FocusNode;
FocusNode pin6FocusNode;
String otpString = '';
int otp;
var statusCode = 0;
createAlertDialog(BuildContext context) {
return showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
'OTP gagal',
),
content: Text(
'OTP yang anda masukan salah',
key: Key('alertText'),
),
actions: <Widget>[
MaterialButton(
elevation: 0.5,
child: Text(
'Coba lagi',
key: Key('backButton'),
textAlign: TextAlign.center,
),
onPressed: () {
Navigator.of(context).pop();
})
],
);
});
}
@override
void initState() {
super.initState();
pin2FocusNode = FocusNode();
pin3FocusNode = FocusNode();
pin4FocusNode = FocusNode();
pin5FocusNode = FocusNode();
pin6FocusNode = FocusNode();
updateduration();
}
@override
void dispose() {
pin2FocusNode.dispose();
pin3FocusNode.dispose();
pin4FocusNode.dispose();
pin5FocusNode.dispose();
pin6FocusNode.dispose();
super.dispose();
}
void nextField({String value, FocusNode focusNode}) {
if (value.length == 1) {
focusNode.requestFocus();
}
}
@override
Widget build(BuildContext context) {
return Form(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SizedBox(
width: 28.98,
height: 33.71,
child: TextFormField(
key: Key('pin1'),
autofocus: true,
keyboardType: TextInputType.number,
style: GoogleFonts.inter(
fontSize: 18, fontWeight: FontWeight.normal, color: black1),
textAlign: TextAlign.center,
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(vertical: 7),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
borderSide: BorderSide(color: gray4)),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
borderSide: BorderSide(color: gray4))),
onChanged: (value) {
nextField(value: value, focusNode: pin2FocusNode);
String stringValue = value.toString();
otpString = otpString + stringValue;
},
),
),
SizedBox(
width: 28.98,
height: 33.71,
child: TextFormField(
key: Key('pin2'),
focusNode: pin2FocusNode,
keyboardType: TextInputType.number,
style: GoogleFonts.inter(
fontSize: 18, fontWeight: FontWeight.normal, color: black1),
textAlign: TextAlign.center,
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(vertical: 7),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
borderSide: BorderSide(color: gray4)),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
borderSide: BorderSide(color: gray4))),
onChanged: (value) {
nextField(value: value, focusNode: pin3FocusNode);
String stringValue = value.toString();
otpString = otpString + stringValue;
},
),
),
SizedBox(
width: 28.98,
height: 33.71,
child: TextFormField(
key: Key('pin3'),
focusNode: pin3FocusNode,
keyboardType: TextInputType.number,
style: GoogleFonts.inter(
fontSize: 18, fontWeight: FontWeight.normal, color: black1),
textAlign: TextAlign.center,
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(vertical: 7),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
borderSide: BorderSide(color: gray4)),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
borderSide: BorderSide(color: gray4))),
onChanged: (value) {
nextField(value: value, focusNode: pin4FocusNode);
String stringValue = value.toString();
otpString = otpString + stringValue;
},
),
),
SizedBox(
width: 28.98,
height: 33.71,
child: TextFormField(
key: Key('pin4'),
focusNode: pin4FocusNode,
keyboardType: TextInputType.number,
style: GoogleFonts.inter(
fontSize: 18, fontWeight: FontWeight.normal, color: black1),
textAlign: TextAlign.center,
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(vertical: 7),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
borderSide: BorderSide(color: gray4)),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
borderSide: BorderSide(color: gray4))),
onChanged: (value) {
nextField(value: value, focusNode: pin5FocusNode);
String stringValue = value.toString();
otpString = otpString + stringValue;
},
),
),
SizedBox(
width: 28.98,
height: 33.71,
child: TextFormField(
key: Key('pin5'),
focusNode: pin5FocusNode,
keyboardType: TextInputType.number,
style: GoogleFonts.inter(
fontSize: 18, fontWeight: FontWeight.normal, color: black1),
textAlign: TextAlign.center,
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(vertical: 7),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
borderSide: BorderSide(color: gray4)),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
borderSide: BorderSide(color: gray4))),
onChanged: (value) {
nextField(value: value, focusNode: pin6FocusNode);
String stringValue = value.toString();
otpString = otpString + stringValue;
},
),
),
SizedBox(
width: 28.98,
height: 33.71,
child: TextFormField(
key: Key('pin6'),
focusNode: pin6FocusNode,
keyboardType: TextInputType.number,
style: GoogleFonts.inter(
fontSize: 18, fontWeight: FontWeight.normal, color: black1),
textAlign: TextAlign.center,
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(vertical: 7),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
borderSide: BorderSide(color: gray4)),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
borderSide: BorderSide(color: gray4))),
onChanged: (value) async {
String stringValue = value.toString();
otpString = otpString + stringValue;
pin6FocusNode.unfocus();
statusCode = await Api().otpInput(
await SecureStorage().readSecureData('token'), otpString);
if (statusCode == 200) {
Navigator.push(context, MaterialPageRoute(builder: (context) {
return MaterialApp(home: HomeKYCUnregistered());
}));
} else if (statusCode == 400) {
createAlertDialog(context);
}
},
),
),
],
),
);
}
}
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:fundex_app/api/api.dart';
import 'package:fundex_app/pages/kyc/design.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:google_fonts/google_fonts.dart';
import 'package:fundex_app/assets/colors.dart'; import 'package:fundex_app/assets/colors.dart';
import '../business/homekycUnregsitered.dart';
class CancelConfirmation extends StatefulWidget { class CancelConfirmation extends StatefulWidget {
@override @override
_CancelConfirmationState createState() => _CancelConfirmationState(); _CancelConfirmationState createState() => _CancelConfirmationState();
...@@ -290,11 +286,6 @@ class __OtpFormState extends State<_OtpForm> { ...@@ -290,11 +286,6 @@ class __OtpFormState extends State<_OtpForm> {
String stringValue = value.toString(); String stringValue = value.toString();
otpString = otpString + stringValue; otpString = otpString + stringValue;
pin6FocusNode.unfocus(); pin6FocusNode.unfocus();
Api().otpInput(
await SecureStorage().readSecureData('token'), otpString);
Navigator.push(context, MaterialPageRoute(builder: (context) {
return MaterialApp(home: HomeKYCUnregistered());
}));
}, },
), ),
), ),
......
...@@ -3,7 +3,7 @@ description: A new Flutter project. ...@@ -3,7 +3,7 @@ description: A new Flutter project.
# The following line prevents the package from being accidentally published to # The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages. # pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev publish_to: "none" # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application. # The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43 # A version number is three numbers separated by dots, like 1.2.43
...@@ -23,8 +23,8 @@ environment: ...@@ -23,8 +23,8 @@ environment:
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
test: '^1.15.7' test: "^1.15.7"
flutter_secure_storage: '^3.3.5' flutter_secure_storage: "^3.3.5"
http: 0.13.0 http: 0.13.0