api integration
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
"signUpText": "اشتراك",
|
"signUpText": "اشتراك",
|
||||||
"welcomeText": "مرحبا بعودتك!",
|
"welcomeText": "مرحبا بعودتك!",
|
||||||
"pleaseEnterLoginDetails": "يرجى إدخال تفاصيل تسجيل الدخول الخاصة بك للبدء",
|
"pleaseEnterLoginDetails": "يرجى إدخال تفاصيل تسجيل الدخول الخاصة بك للبدء",
|
||||||
"toGetYourAccountPleaseSetYourInfo": "للحصول على حسابك، يرجى تحديد معلوماتك",
|
"toGetYourAccountPleaseSetYourInfo": "للحصول على حسابك، يرجى تحديد معلوماتك",
|
||||||
"countryOfResidence": "بلد الإقامة",
|
"countryOfResidence": "بلد الإقامة",
|
||||||
"chooseCountry": "اختر الدولة",
|
"chooseCountry": "اختر الدولة",
|
||||||
"phoneNumber": "رقم الهاتف",
|
"phoneNumber": "رقم الهاتف",
|
||||||
@@ -245,6 +245,14 @@
|
|||||||
"tryAgainText": "حاول مرة اخرى",
|
"tryAgainText": "حاول مرة اخرى",
|
||||||
"investmentConfirmationText": "تأكيد الاستثمار",
|
"investmentConfirmationText": "تأكيد الاستثمار",
|
||||||
"enterAmountText": "أدخل المبلغ",
|
"enterAmountText": "أدخل المبلغ",
|
||||||
"pleaseEnterAmountText": "الرجاء إدخال المبلغ"
|
"pleaseEnterAmountText": "الرجاء إدخال المبلغ",
|
||||||
|
"authenticationFailedText" : "المصادقة فشلت",
|
||||||
|
"pleaseAuthenticateToAccessTheApp" : "يرجى المصادقة للوصول إلى التطبيق",
|
||||||
|
"masterPinAddedSucessfullyText" : "تمت إضافة الدبوس الرئيسي بنجاح",
|
||||||
|
"passwordChangedSucessfully" : "تم تغيير الرقم السري بنجاح!",
|
||||||
|
"passwordResetSucessful" : "تمت إعادة تعيين كلمة المرور بنجاح!",
|
||||||
|
"otpSendSuccessfulText" : "تم إرسال OTP بنجاح!",
|
||||||
|
"successfulText" : "ناجح !",
|
||||||
|
"portfolioBottomText" : "مَلَفّ"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
"resendSms": "Resend SMS",
|
"resendSms": "Resend SMS",
|
||||||
"otpVerifiedSucessfully": "OTP Verified Successfully!",
|
"otpVerifiedSucessfully": "OTP Verified Successfully!",
|
||||||
"otpVerifiedFailed": "OTP Verification Failed:",
|
"otpVerifiedFailed": "OTP Verification Failed:",
|
||||||
"pinCode": "Pin Code",
|
"pinCode": "Pin Code",
|
||||||
"createPinCode": "Create Pin Code",
|
"createPinCode": "Create Pin Code",
|
||||||
"changePinCode": "Change Pin Code",
|
"changePinCode": "Change Pin Code",
|
||||||
"confirmPinCode": "Confirm Pin Code",
|
"confirmPinCode": "Confirm Pin Code",
|
||||||
@@ -245,6 +245,14 @@
|
|||||||
"tryAgainText": "Try again",
|
"tryAgainText": "Try again",
|
||||||
"investmentConfirmationText": "Investment confirmation",
|
"investmentConfirmationText": "Investment confirmation",
|
||||||
"enterAmountText": "Enter Amount",
|
"enterAmountText": "Enter Amount",
|
||||||
"pleaseEnterAmountText": "Please Enter Amount"
|
"pleaseEnterAmountText": "Please Enter Amount",
|
||||||
|
"authenticationFailedText" : "Authentication failed",
|
||||||
|
"pleaseAuthenticateToAccessTheApp" : "Please authenticate to access the app",
|
||||||
|
"masterPinAddedSucessfullyText" : "Master pin added sucessfully",
|
||||||
|
"passwordChangedSucessfully" : "Password changed successfully!",
|
||||||
|
"passwordResetSucessful" : "Password reset successful!",
|
||||||
|
"otpSendSuccessfulText" : "OTP send successful !",
|
||||||
|
"successfulText" : "successful !",
|
||||||
|
"portfolioBottomText" : "Portfolio"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,6 +37,9 @@ class AppText {
|
|||||||
"Password must contain at least one digit.";
|
"Password must contain at least one digit.";
|
||||||
static const String passwordSpecialCharacter =
|
static const String passwordSpecialCharacter =
|
||||||
"Password must contain at least one special character (!@#\$%&*()-+=^).";
|
"Password must contain at least one special character (!@#\$%&*()-+=^).";
|
||||||
|
static const String authenticationFailedText = "authenticationFailedText";
|
||||||
|
static const String pleaseAuthenticateToAccessTheApp =
|
||||||
|
"pleaseAuthenticateToAccessTheApp";
|
||||||
|
|
||||||
//Register
|
//Register
|
||||||
static const String getStartedToday = "getStartedToday";
|
static const String getStartedToday = "getStartedToday";
|
||||||
@@ -73,6 +76,7 @@ class AppText {
|
|||||||
static const String termsAndCondition = "termsAndCondition";
|
static const String termsAndCondition = "termsAndCondition";
|
||||||
static const String andThe = "andThe";
|
static const String andThe = "andThe";
|
||||||
static const String privacyPolicy = "privacyPolicy";
|
static const String privacyPolicy = "privacyPolicy";
|
||||||
|
static const String successfulText = "successfulText";
|
||||||
|
|
||||||
//Country Name
|
//Country Name
|
||||||
static const String bahrainCountryText = "Bahrain";
|
static const String bahrainCountryText = "Bahrain";
|
||||||
@@ -91,6 +95,7 @@ class AppText {
|
|||||||
static const String totalreturn = "totalreturn";
|
static const String totalreturn = "totalreturn";
|
||||||
static const String disttodate = "disttodate";
|
static const String disttodate = "disttodate";
|
||||||
static const String includeddocs = "includeddocs";
|
static const String includeddocs = "includeddocs";
|
||||||
|
static const String portfolioBottomText = "portfolioBottomText";
|
||||||
|
|
||||||
//Academy
|
//Academy
|
||||||
static const String videosTitle = "videosTitle";
|
static const String videosTitle = "videosTitle";
|
||||||
@@ -118,6 +123,7 @@ class AppText {
|
|||||||
static const String resendSms = "resendSms";
|
static const String resendSms = "resendSms";
|
||||||
static const String otpVerifiedSucessfully = "otpVerifiedSucessfully";
|
static const String otpVerifiedSucessfully = "otpVerifiedSucessfully";
|
||||||
static const String otpVerifiedFailed = "otpVerifiedFailed";
|
static const String otpVerifiedFailed = "otpVerifiedFailed";
|
||||||
|
static const String otpSendSuccessfulText = "otpSendSuccessfulText";
|
||||||
|
|
||||||
//Pin Code
|
//Pin Code
|
||||||
static const String pinCode = "pinCode";
|
static const String pinCode = "pinCode";
|
||||||
@@ -135,17 +141,19 @@ class AppText {
|
|||||||
"toRestorePinYouWillBeLoggedOut";
|
"toRestorePinYouWillBeLoggedOut";
|
||||||
static const String allowText = "allowText";
|
static const String allowText = "allowText";
|
||||||
static const String declineText = "declineText";
|
static const String declineText = "declineText";
|
||||||
|
static const String masterPinAddedSucessfullyText =
|
||||||
|
"masterPinAddedSucessfullyText";
|
||||||
|
|
||||||
//Forgot Password
|
//Forgot Password
|
||||||
static const String almostHere = "almostHere";
|
static const String almostHere = "almostHere";
|
||||||
static const String completeAcc = "completeAcc";
|
static const String completeAcc = "completeAcc";
|
||||||
|
|
||||||
//Forgot Password
|
|
||||||
static const String restorePasswordText = "restorePasswordText";
|
static const String restorePasswordText = "restorePasswordText";
|
||||||
static const String toRestorePasswordPleaseEnterPhoneNumber =
|
static const String toRestorePasswordPleaseEnterPhoneNumber =
|
||||||
"toRestorePasswordPleaseEnterPhoneNumber";
|
"toRestorePasswordPleaseEnterPhoneNumber";
|
||||||
static const String createNewPasswordText = "createNewPasswordText";
|
static const String createNewPasswordText = "createNewPasswordText";
|
||||||
static const String submitText = "submitText";
|
static const String submitText = "submitText";
|
||||||
|
static const String passwordChangedSucessfully = "passwordChangedSucessfully";
|
||||||
|
static const String passwordResetSucessful = "passwordResetSucessful";
|
||||||
|
|
||||||
//Wallet
|
//Wallet
|
||||||
static const String walletTitle = "walletTitle";
|
static const String walletTitle = "walletTitle";
|
||||||
|
|||||||
@@ -26,5 +26,6 @@ class PhoneNumberHintGenerator {
|
|||||||
"+974": 8, // Qatar
|
"+974": 8, // Qatar
|
||||||
"+966": 9, // Saudi Arabia
|
"+966": 9, // Saudi Arabia
|
||||||
"+971": 9, // United Arab Emirates
|
"+971": 9, // United Arab Emirates
|
||||||
|
"+91": 10,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
12
lib/features/biometric/domain/repository/biometric_api.dart
Normal file
12
lib/features/biometric/domain/repository/biometric_api.dart
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import '../../../../Api_Helper/base_manager.dart';
|
||||||
|
import '../../../../shared/api/api_endpoints.dart';
|
||||||
|
import '../../../../shared/api/network_api_services.dart';
|
||||||
|
|
||||||
|
class BiometricAPIServices {
|
||||||
|
BiometricAPIServices();
|
||||||
|
Future<ResponseData> biometricLoginApi(Map<String, dynamic> data) async {
|
||||||
|
String url = ApiEndpoints.biometricLoginapi;
|
||||||
|
final response = await NetworkApiService().post(url, data);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,14 +2,19 @@ import 'dart:io';
|
|||||||
|
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:local_auth/local_auth.dart';
|
import 'package:local_auth/local_auth.dart';
|
||||||
|
import 'package:tanami_app/core/utils/secure/secure_storage_service.dart';
|
||||||
|
import 'package:tanami_app/features/biometric/domain/repository/biometric_api.dart';
|
||||||
|
|
||||||
|
import '../../../../Api_Helper/base_manager.dart';
|
||||||
import 'biometric_event.dart';
|
import 'biometric_event.dart';
|
||||||
import 'biometric_state.dart';
|
import 'biometric_state.dart';
|
||||||
|
|
||||||
class BiometricBloc extends Bloc<BiometricEvent, BiometricState> {
|
class BiometricBloc extends Bloc<BiometricEvent, BiometricState> {
|
||||||
final LocalAuthentication localAuthentication;
|
final LocalAuthentication localAuthentication;
|
||||||
|
final SecureStorageService secureStorageService;
|
||||||
|
|
||||||
BiometricBloc(this.localAuthentication) : super(BiometricInitial()) {
|
BiometricBloc(this.localAuthentication, this.secureStorageService)
|
||||||
|
: super(BiometricInitial()) {
|
||||||
on<CheckBiometricEvent>(_onCheckBiometric);
|
on<CheckBiometricEvent>(_onCheckBiometric);
|
||||||
on<AuthenticateBiometricEvent>(_onAuthenticateBiometric);
|
on<AuthenticateBiometricEvent>(_onAuthenticateBiometric);
|
||||||
}
|
}
|
||||||
@@ -46,7 +51,21 @@ class BiometricBloc extends Bloc<BiometricEvent, BiometricState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (authenticated) {
|
if (authenticated) {
|
||||||
emit(BiometricAuthenticated());
|
Map<String, dynamic> biometricLoginData = {
|
||||||
|
"token": await secureStorageService.read("temp_token"),
|
||||||
|
};
|
||||||
|
|
||||||
|
ResponseData response =
|
||||||
|
await BiometricAPIServices().biometricLoginApi(biometricLoginData);
|
||||||
|
if (response.status == ResponseStatus.SUCCESS) {
|
||||||
|
await secureStorageService.write(
|
||||||
|
'accesstoken', response.data["data"]["accessToken"]);
|
||||||
|
await secureStorageService.write(
|
||||||
|
'refreshtoken', response.data["data"]["refreshToken"]);
|
||||||
|
emit(BiometricAuthenticated());
|
||||||
|
} else {
|
||||||
|
emit(BiometricFailed('Authentication failed'));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
emit(BiometricFailed('Authentication failed'));
|
emit(BiometricFailed('Authentication failed'));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ class BiometricLayout extends StatelessWidget {
|
|||||||
deviceLockedDialog(context);
|
deviceLockedDialog(context);
|
||||||
} else if (state is BiometricAuthenticated) {
|
} else if (state is BiometricAuthenticated) {
|
||||||
await secureStorageService.write('isLoginedIn', "true");
|
await secureStorageService.write('isLoginedIn', "true");
|
||||||
// successToastMessage(context, "Authentication Successful");
|
|
||||||
goRouter.goNamed(RouteName.mainScreen);
|
goRouter.goNamed(RouteName.mainScreen);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -30,7 +30,8 @@ class RestorePasswordBottomSection extends StatelessWidget {
|
|||||||
if (state is ChangePasswordLoading) {
|
if (state is ChangePasswordLoading) {
|
||||||
Loader.loader(context);
|
Loader.loader(context);
|
||||||
} else if (state is ChangePasswordSuccess) {
|
} else if (state is ChangePasswordSuccess) {
|
||||||
successToastMessage(context, "Password changed successful !");
|
successToastMessage(context,
|
||||||
|
localizations.translate(AppText.passwordChangedSucessfully));
|
||||||
goRouter.pop();
|
goRouter.pop();
|
||||||
goRouter.pop();
|
goRouter.pop();
|
||||||
} else if (state is ChangePasswordFailure) {
|
} else if (state is ChangePasswordFailure) {
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ class ChooseCountryLayout extends StatelessWidget {
|
|||||||
child: ButtonWidget().elevatedBtn(
|
child: ButtonWidget().elevatedBtn(
|
||||||
txtClr: AppColor.plainWhite,
|
txtClr: AppColor.plainWhite,
|
||||||
function: () {
|
function: () {
|
||||||
print("//");
|
|
||||||
goRouter.pop();
|
goRouter.pop();
|
||||||
},
|
},
|
||||||
text: localizations.translate(AppText.confirmSelectionText),
|
text: localizations.translate(AppText.confirmSelectionText),
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ class RestorePasswordBottomSection extends StatelessWidget {
|
|||||||
if (state is RestorePasswordLoading) {
|
if (state is RestorePasswordLoading) {
|
||||||
Loader.loader(context);
|
Loader.loader(context);
|
||||||
} else if (state is RestorePasswordSuccess) {
|
} else if (state is RestorePasswordSuccess) {
|
||||||
successToastMessage(context, "Password resetted successful !");
|
successToastMessage(context,
|
||||||
|
localizations.translate(AppText.passwordResetSucessful));
|
||||||
goRouter.pop();
|
goRouter.pop();
|
||||||
radioBloc.resetSelection();
|
radioBloc.resetSelection();
|
||||||
goRouter.goNamed(RouteName.loginScreen, pathParameters: {
|
goRouter.goNamed(RouteName.loginScreen, pathParameters: {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class RestorePasswordForm extends StatelessWidget {
|
|||||||
create: (_) => PasswordVisibilityBloc(),
|
create: (_) => PasswordVisibilityBloc(),
|
||||||
child: FormLabelTextField(
|
child: FormLabelTextField(
|
||||||
hintText: localizations.translate(AppText.enterPassword),
|
hintText: localizations.translate(AppText.enterPassword),
|
||||||
title: "New Password",
|
title: localizations.translate(AppText.newPasswordText),
|
||||||
type: AppText.password.toLowerCase(),
|
type: AppText.password.toLowerCase(),
|
||||||
textEditingController: restorePasswordBloc.passwordTextField,
|
textEditingController: restorePasswordBloc.passwordTextField,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -36,7 +36,8 @@ class RestorePasswordPhoneVerificationBottomSection extends StatelessWidget {
|
|||||||
if (state is RestorePasswordPhoneVerificationLoading) {
|
if (state is RestorePasswordPhoneVerificationLoading) {
|
||||||
Loader.loader(context);
|
Loader.loader(context);
|
||||||
} else if (state is RestorePasswordPhoneVerificationSuccess) {
|
} else if (state is RestorePasswordPhoneVerificationSuccess) {
|
||||||
successToastMessage(context, "OTP send successful !");
|
successToastMessage(context,
|
||||||
|
localizations.translate(AppText.otpSendSuccessfulText));
|
||||||
goRouter.pop();
|
goRouter.pop();
|
||||||
radioBloc.resetSelection();
|
radioBloc.resetSelection();
|
||||||
goRouter.pushNamed(RouteName.otpScreen,
|
goRouter.pushNamed(RouteName.otpScreen,
|
||||||
|
|||||||
@@ -54,6 +54,8 @@ class LoginBloc extends Bloc<LoginEvent, LoginState> {
|
|||||||
await secureStorageService.write(
|
await secureStorageService.write(
|
||||||
'temp_token', response.data['data']['user']);
|
'temp_token', response.data['data']['user']);
|
||||||
emit(LoginMasterPinPending());
|
emit(LoginMasterPinPending());
|
||||||
|
} else {
|
||||||
|
emit(LoginFailure(response.message.toString()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
emit(const LoginFailure(
|
emit(const LoginFailure(
|
||||||
|
|||||||
@@ -21,27 +21,8 @@ class OTPBloc extends Bloc<OTPEvent, OTPState> {
|
|||||||
} else {
|
} else {
|
||||||
emit(OTPFailed("Oops something went wrong"));
|
emit(OTPFailed("Oops something went wrong"));
|
||||||
}
|
}
|
||||||
print("//");
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
emit(OTPError("Oops something went wrong"));
|
emit(OTPError("Oops something went wrong"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Future<void> VerifyOTPCall(
|
|
||||||
GetCountry event, Emitter<GetCountryState> emit) async {
|
|
||||||
if (event is GetCountry) {
|
|
||||||
emit(CountryLoading());
|
|
||||||
try {
|
|
||||||
ResponseData response = await GetCountryAPI().getcountryAPI();
|
|
||||||
if (response.status == ResponseStatus.SUCCESS) {
|
|
||||||
GetCountryModel countryModel =
|
|
||||||
GetCountryModel.fromJson(response.data);
|
|
||||||
emit(CountryLoaded(countryModel));
|
|
||||||
}
|
|
||||||
print("//");
|
|
||||||
} catch (e) {
|
|
||||||
emit(CountryError("Oops Something went wrong"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} */
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,21 +33,19 @@ class ResendOtpSection extends StatelessWidget {
|
|||||||
loginBloc.phoneNumberTextField.text = Globalconst.phonenumber;
|
loginBloc.phoneNumberTextField.text = Globalconst.phonenumber;
|
||||||
loginBloc.countrySelectionTextField.text = Globalconst.name;
|
loginBloc.countrySelectionTextField.text = Globalconst.name;
|
||||||
var localizations = AppLocalizations.of(context);
|
var localizations = AppLocalizations.of(context);
|
||||||
final SecureStorageService secureStorageService = SecureStorageService();
|
|
||||||
return BlocBuilder<TimerBloc, TimerState>(
|
return BlocBuilder<TimerBloc, TimerState>(
|
||||||
builder: (context, state) {
|
builder: (context, timerState) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 10),
|
padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 10),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
TextWidget().text14W500(
|
TextWidget().text14W500(
|
||||||
state.formattedDuration,
|
timerState.formattedDuration,
|
||||||
clr: AppColor.plainBlack,
|
clr: AppColor.plainBlack,
|
||||||
),
|
),
|
||||||
BlocConsumer<RegisterBloc, RegisterState>(
|
BlocConsumer<RegisterBloc, RegisterState>(
|
||||||
listener: (context, state) {
|
listener: (context, state) {
|
||||||
print(loginBloc.state);
|
|
||||||
if (state is RegisterLoading) {
|
if (state is RegisterLoading) {
|
||||||
Loader.loader(context);
|
Loader.loader(context);
|
||||||
} else if (state is RegisterSuccess) {
|
} else if (state is RegisterSuccess) {
|
||||||
@@ -72,12 +70,14 @@ class ResendOtpSection extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
loginBloc.add(
|
if (timerState is TimerRunComplete) {
|
||||||
Resendotp(token),
|
loginBloc.add(
|
||||||
);
|
Resendotp(token),
|
||||||
print("///");
|
);
|
||||||
|
} else {
|
||||||
// successToastMessage(context, "OTP Resend Sucessfully !");
|
errorToastMessage(context,
|
||||||
|
"Please wait ${timerState.formattedDuration} Minutes before resending OTP");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: TextWidget().text14W500(
|
child: TextWidget().text14W500(
|
||||||
localizations.translate(AppText.resendSms),
|
localizations.translate(AppText.resendSms),
|
||||||
@@ -89,24 +89,6 @@ class ResendOtpSection extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
/* GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
regbloc.add(
|
|
||||||
RegisterSubmitted(
|
|
||||||
loginBloc.phoneNumberTextField.text,
|
|
||||||
loginBloc.countrySelectionTextField.text,
|
|
||||||
loginBloc.isdcode
|
|
||||||
),
|
|
||||||
);
|
|
||||||
print("///");
|
|
||||||
// successToastMessage(context, "OTP Resend Sucessfully !");
|
|
||||||
},
|
|
||||||
child: TextWidget().text14W500(
|
|
||||||
localizations.translate(AppText.resendSms),
|
|
||||||
clr: AppColor.plainBlack,
|
|
||||||
textDecoration: TextDecoration.underline,
|
|
||||||
),
|
|
||||||
) */
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class RegisterBloc extends Bloc<RegisterEvent, RegisterState> {
|
|||||||
emit(RegisterLoading());
|
emit(RegisterLoading());
|
||||||
try {
|
try {
|
||||||
Map<String, dynamic> requestdata = {
|
Map<String, dynamic> requestdata = {
|
||||||
"token": secureStorageService.read('temp_token'),
|
"token": await secureStorageService.read('temp_token'),
|
||||||
};
|
};
|
||||||
ResponseData response = await OTPAPI().resendOTPRequest(requestdata);
|
ResponseData response = await OTPAPI().resendOTPRequest(requestdata);
|
||||||
if (response.status == ResponseStatus.SUCCESS) {
|
if (response.status == ResponseStatus.SUCCESS) {
|
||||||
|
|||||||
@@ -39,11 +39,11 @@ class RegisterBottomSection extends StatelessWidget {
|
|||||||
const Gap(36),
|
const Gap(36),
|
||||||
BlocConsumer<RegisterBloc, RegisterState>(
|
BlocConsumer<RegisterBloc, RegisterState>(
|
||||||
listener: (context, state) {
|
listener: (context, state) {
|
||||||
print(loginBloc.state);
|
|
||||||
if (state is RegisterLoading) {
|
if (state is RegisterLoading) {
|
||||||
Loader.loader(context);
|
Loader.loader(context);
|
||||||
} else if (state is RegisterSuccess) {
|
} else if (state is RegisterSuccess) {
|
||||||
successToastMessage(context, "successful !");
|
successToastMessage(
|
||||||
|
context, localizations.translate(AppText.successfulText));
|
||||||
goRouter.pop();
|
goRouter.pop();
|
||||||
|
|
||||||
goRouter.pushNamed(RouteName.otpScreen,
|
goRouter.pushNamed(RouteName.otpScreen,
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'package:equatable/equatable.dart';
|
|||||||
import 'package:tanami_app/Api_Helper/base_manager.dart';
|
import 'package:tanami_app/Api_Helper/base_manager.dart';
|
||||||
import 'package:tanami_app/core/styles/app_text.dart';
|
import 'package:tanami_app/core/styles/app_text.dart';
|
||||||
|
|
||||||
|
import '../../../../core/routes/routes.dart';
|
||||||
import '../../../../core/utils/secure/secure_storage_service.dart';
|
import '../../../../core/utils/secure/secure_storage_service.dart';
|
||||||
import '../../Repository/PinAPIServices.dart';
|
import '../../Repository/PinAPIServices.dart';
|
||||||
|
|
||||||
@@ -71,6 +72,7 @@ class PinBloc extends Bloc<PinEvent, PinState> {
|
|||||||
});
|
});
|
||||||
|
|
||||||
on<VerifyPinPressed>((event, emit) async {
|
on<VerifyPinPressed>((event, emit) async {
|
||||||
|
emit(const PinLoading());
|
||||||
final storedPin = await secureStorageService.read('pin_code');
|
final storedPin = await secureStorageService.read('pin_code');
|
||||||
Map<String, dynamic> pindata = {
|
Map<String, dynamic> pindata = {
|
||||||
"token": await secureStorageService.read("temp_token"),
|
"token": await secureStorageService.read("temp_token"),
|
||||||
@@ -82,8 +84,13 @@ class PinBloc extends Bloc<PinEvent, PinState> {
|
|||||||
await secureStorageService.write('userMPIN', storedPin.toString());
|
await secureStorageService.write('userMPIN', storedPin.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
emit(state.copyWith(isVerified: true, error: '', verifiedOnce: true));
|
emit(state.copyWith(
|
||||||
|
isVerified: true,
|
||||||
|
error: '',
|
||||||
|
verifiedOnce: true,
|
||||||
|
pinComplete: true));
|
||||||
} else {
|
} else {
|
||||||
|
goRouter.pop();
|
||||||
emit(state.copyWith(
|
emit(state.copyWith(
|
||||||
isVerified: false,
|
isVerified: false,
|
||||||
error: AppText.incorrectPinCode,
|
error: AppText.incorrectPinCode,
|
||||||
@@ -93,6 +100,7 @@ class PinBloc extends Bloc<PinEvent, PinState> {
|
|||||||
});
|
});
|
||||||
|
|
||||||
on<VerifyLoginPinPressed>((event, emit) async {
|
on<VerifyLoginPinPressed>((event, emit) async {
|
||||||
|
emit(const PinLoading());
|
||||||
Map<String, dynamic> pindata = {
|
Map<String, dynamic> pindata = {
|
||||||
"token": await secureStorageService.read("temp_token"),
|
"token": await secureStorageService.read("temp_token"),
|
||||||
"masterPin": event.pin
|
"masterPin": event.pin
|
||||||
@@ -100,6 +108,10 @@ class PinBloc extends Bloc<PinEvent, PinState> {
|
|||||||
|
|
||||||
ResponseData response = await PinAPIServices().Verifypin(pindata);
|
ResponseData response = await PinAPIServices().Verifypin(pindata);
|
||||||
if (response.status == ResponseStatus.SUCCESS) {
|
if (response.status == ResponseStatus.SUCCESS) {
|
||||||
|
await secureStorageService.write(
|
||||||
|
'accesstoken', response.data["data"]["accessToken"]);
|
||||||
|
await secureStorageService.write(
|
||||||
|
'refreshtoken', response.data["data"]["refreshToken"]);
|
||||||
emit(state.copyWith(
|
emit(state.copyWith(
|
||||||
pinComplete: true,
|
pinComplete: true,
|
||||||
pin: state.pin,
|
pin: state.pin,
|
||||||
@@ -107,6 +119,7 @@ class PinBloc extends Bloc<PinEvent, PinState> {
|
|||||||
error: '',
|
error: '',
|
||||||
verifiedOnce: false));
|
verifiedOnce: false));
|
||||||
} else {
|
} else {
|
||||||
|
goRouter.pop();
|
||||||
emit(state.copyWith(
|
emit(state.copyWith(
|
||||||
pinComplete: true,
|
pinComplete: true,
|
||||||
pin: state.pin,
|
pin: state.pin,
|
||||||
|
|||||||
@@ -34,3 +34,13 @@ class PinState extends Equatable {
|
|||||||
@override
|
@override
|
||||||
List<Object> get props => [pin, pinComplete, isVerified, error, verifiedOnce];
|
List<Object> get props => [pin, pinComplete, isVerified, error, verifiedOnce];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class PinLoading extends PinState {
|
||||||
|
const PinLoading()
|
||||||
|
: super(
|
||||||
|
pin: '',
|
||||||
|
pinComplete: false,
|
||||||
|
isVerified: false,
|
||||||
|
error: '',
|
||||||
|
verifiedOnce: false);
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,9 +4,13 @@ import 'package:gap/gap.dart';
|
|||||||
import 'package:tanami_app/core/routes/route_name.dart';
|
import 'package:tanami_app/core/routes/route_name.dart';
|
||||||
import 'package:tanami_app/core/routes/routes.dart';
|
import 'package:tanami_app/core/routes/routes.dart';
|
||||||
import 'package:tanami_app/core/styles/app_color.dart';
|
import 'package:tanami_app/core/styles/app_color.dart';
|
||||||
|
import 'package:tanami_app/core/styles/app_text.dart';
|
||||||
import 'package:tanami_app/core/utils/secure/secure_storage_service.dart';
|
import 'package:tanami_app/core/utils/secure/secure_storage_service.dart';
|
||||||
import 'package:tanami_app/shared/components/text_widget.dart';
|
import 'package:tanami_app/shared/components/text_widget.dart';
|
||||||
|
import 'package:tanami_app/shared/components/toast_message.dart';
|
||||||
|
|
||||||
|
import '../../../../core/utils/language/localizations_delegate.dart';
|
||||||
|
import '../../../../shared/components/loader.dart';
|
||||||
import '../bloc/pin_bloc.dart';
|
import '../bloc/pin_bloc.dart';
|
||||||
|
|
||||||
class ConfirmPinKey extends StatelessWidget {
|
class ConfirmPinKey extends StatelessWidget {
|
||||||
@@ -14,13 +18,22 @@ class ConfirmPinKey extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
var localizations = AppLocalizations.of(context);
|
||||||
final SecureStorageService secureStorageService = SecureStorageService();
|
final SecureStorageService secureStorageService = SecureStorageService();
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
const Gap(20),
|
const Gap(20),
|
||||||
BlocConsumer<PinBloc, PinState>(
|
BlocConsumer<PinBloc, PinState>(
|
||||||
listener: (context, state) async {
|
listener: (context, state) async {
|
||||||
|
if (state is PinLoading) {
|
||||||
|
Loader.loader(context);
|
||||||
|
}
|
||||||
if (state.pinComplete && state.isVerified) {
|
if (state.pinComplete && state.isVerified) {
|
||||||
|
goRouter.pop();
|
||||||
|
successToastMessage(
|
||||||
|
context,
|
||||||
|
localizations
|
||||||
|
.translate(AppText.masterPinAddedSucessfullyText));
|
||||||
await secureStorageService.write('isLoginedIn', "true");
|
await secureStorageService.write('isLoginedIn', "true");
|
||||||
goRouter.goNamed(RouteName.mainScreen);
|
goRouter.goNamed(RouteName.mainScreen);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import 'package:tanami_app/shared/components/text_widget.dart';
|
|||||||
import '../../../../core/routes/route_name.dart';
|
import '../../../../core/routes/route_name.dart';
|
||||||
import '../../../../core/routes/routes.dart';
|
import '../../../../core/routes/routes.dart';
|
||||||
import '../../../../core/utils/language/localizations_delegate.dart';
|
import '../../../../core/utils/language/localizations_delegate.dart';
|
||||||
|
import '../../../../shared/components/loader.dart';
|
||||||
import '../../../../shared/components/toast_message.dart';
|
import '../../../../shared/components/toast_message.dart';
|
||||||
import '../../../login/presentation/bloc/login_bloc.dart';
|
import '../../../login/presentation/bloc/login_bloc.dart';
|
||||||
import '../bloc/pin_bloc.dart';
|
import '../bloc/pin_bloc.dart';
|
||||||
@@ -32,10 +33,14 @@ class PinKey extends StatelessWidget {
|
|||||||
const Gap(20),
|
const Gap(20),
|
||||||
BlocConsumer<PinBloc, PinState>(
|
BlocConsumer<PinBloc, PinState>(
|
||||||
listener: (context, state) {
|
listener: (context, state) {
|
||||||
|
if (state is PinLoading) {
|
||||||
|
Loader.loader(context);
|
||||||
|
}
|
||||||
if (state.pinComplete &&
|
if (state.pinComplete &&
|
||||||
state.error.isEmpty &&
|
state.error.isEmpty &&
|
||||||
!state.verifiedOnce) {
|
!state.verifiedOnce) {
|
||||||
if (fromScreen == "login" || fromScreen == "LoginedInUser") {
|
if (fromScreen == "login" || fromScreen == "LoginedInUser") {
|
||||||
|
goRouter.pop();
|
||||||
loginBloc.resetFields();
|
loginBloc.resetFields();
|
||||||
radioBloc.resetSelection();
|
radioBloc.resetSelection();
|
||||||
successToastMessage(context,
|
successToastMessage(context,
|
||||||
@@ -46,10 +51,12 @@ class PinKey extends StatelessWidget {
|
|||||||
context, localizations.translate(AppText.pinUpdatedSucess));
|
context, localizations.translate(AppText.pinUpdatedSucess));
|
||||||
goRouter.pop();
|
goRouter.pop();
|
||||||
} else {
|
} else {
|
||||||
|
goRouter.pop();
|
||||||
context.read<PinBloc>().add(SavePinPressed());
|
context.read<PinBloc>().add(SavePinPressed());
|
||||||
goRouter.pushNamed(RouteName.confirmPinScreen);
|
goRouter.pushNamed(RouteName.confirmPinScreen);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// goRouter.pop();
|
||||||
if (state.pinComplete) {
|
if (state.pinComplete) {
|
||||||
errorToastMessage(
|
errorToastMessage(
|
||||||
context,
|
context,
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
|||||||
import 'package:tanami_app/features/welcome/presentation/pages/welcome_layout.dart';
|
import 'package:tanami_app/features/welcome/presentation/pages/welcome_layout.dart';
|
||||||
|
|
||||||
import '../../../../core/styles/app_color.dart';
|
import '../../../../core/styles/app_color.dart';
|
||||||
|
import '../../../../shared/components/exit_app_dialog.dart';
|
||||||
import '../bloc/onboarding_bloc.dart';
|
import '../bloc/onboarding_bloc.dart';
|
||||||
|
|
||||||
class WelcomeScreen extends StatelessWidget {
|
class WelcomeScreen extends StatelessWidget {
|
||||||
@@ -10,17 +11,23 @@ class WelcomeScreen extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return WillPopScope(
|
||||||
backgroundColor: AppColor.plainWhite,
|
onWillPop: () async {
|
||||||
body: MultiBlocProvider(
|
exitAppDialog(context);
|
||||||
// Define the providers for the OnboardingBloc and other blocs
|
return false;
|
||||||
providers: [
|
},
|
||||||
BlocProvider(
|
child: Scaffold(
|
||||||
// Create an instance of the OnboardingBloc
|
backgroundColor: AppColor.plainWhite,
|
||||||
create: (_) => OnboardingBloc(),
|
body: MultiBlocProvider(
|
||||||
),
|
// Define the providers for the OnboardingBloc and other blocs
|
||||||
],
|
providers: [
|
||||||
child: WelcomeLayout(),
|
BlocProvider(
|
||||||
|
// Create an instance of the OnboardingBloc
|
||||||
|
create: (_) => OnboardingBloc(),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
child: WelcomeLayout(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,8 +107,10 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
|||||||
create: (_) => LoginBloc(secureStorageService: secureStorageService),
|
create: (_) => LoginBloc(secureStorageService: secureStorageService),
|
||||||
),
|
),
|
||||||
BlocProvider(
|
BlocProvider(
|
||||||
create: (_) =>
|
create: (_) => BiometricBloc(
|
||||||
BiometricBloc(LocalAuthentication())..add(CheckBiometricEvent()),
|
LocalAuthentication(),
|
||||||
|
secureStorageService,
|
||||||
|
)..add(CheckBiometricEvent()),
|
||||||
),
|
),
|
||||||
BlocProvider(
|
BlocProvider(
|
||||||
create: (_) => LocalizationBloc(),
|
create: (_) => LocalizationBloc(),
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ class ApiEndpoints {
|
|||||||
|
|
||||||
//Biometric
|
//Biometric
|
||||||
static const biometricUpdateapi = "${baseurl}auth/public/biometric-update";
|
static const biometricUpdateapi = "${baseurl}auth/public/biometric-update";
|
||||||
|
static const biometricLoginapi = "${baseurl}auth/public/biometric-login";
|
||||||
|
|
||||||
//PIN
|
//PIN
|
||||||
static const confirmpinapi = "${baseurl}auth/public/masterPin";
|
static const confirmpinapi = "${baseurl}auth/public/masterPin";
|
||||||
|
|||||||
@@ -76,6 +76,10 @@ class NetworkApiService {
|
|||||||
response.data['error']['message'], ResponseStatus.PRIVATE,
|
response.data['error']['message'], ResponseStatus.PRIVATE,
|
||||||
data: response.data);
|
data: response.data);
|
||||||
}
|
}
|
||||||
|
} else if (response.statusCode == 401) {
|
||||||
|
return ResponseData<dynamic>(
|
||||||
|
response.data['error']['message'], ResponseStatus.PRIVATE,
|
||||||
|
data: response.data);
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
return ResponseData<dynamic>(
|
return ResponseData<dynamic>(
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
|||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:tanami_app/core/styles/app_color.dart';
|
import 'package:tanami_app/core/styles/app_color.dart';
|
||||||
|
import 'package:tanami_app/core/styles/app_text.dart';
|
||||||
|
|
||||||
import '../../core/utils/language/localizations_delegate.dart';
|
import '../../core/utils/language/localizations_delegate.dart';
|
||||||
import 'bloc/bottom_nav_bar/bottom_navigation_bloc.dart';
|
import 'bloc/bottom_nav_bar/bottom_navigation_bloc.dart';
|
||||||
@@ -45,7 +46,7 @@ Widget bottomnavigationbar(
|
|||||||
height: 30.h,
|
height: 30.h,
|
||||||
width: 30.w,
|
width: 30.w,
|
||||||
),
|
),
|
||||||
label: localizations.translate('Wallet'),
|
label: localizations.translate(AppText.walletText),
|
||||||
),
|
),
|
||||||
BottomNavigationBarItem(
|
BottomNavigationBarItem(
|
||||||
icon: Image.asset(
|
icon: Image.asset(
|
||||||
@@ -58,7 +59,7 @@ Widget bottomnavigationbar(
|
|||||||
height: 30.h,
|
height: 30.h,
|
||||||
width: 30.w,
|
width: 30.w,
|
||||||
),
|
),
|
||||||
label: localizations.translate('Portfolio'),
|
label: localizations.translate(AppText.portfolioBottomText),
|
||||||
),
|
),
|
||||||
BottomNavigationBarItem(
|
BottomNavigationBarItem(
|
||||||
icon: Image.asset(
|
icon: Image.asset(
|
||||||
@@ -71,7 +72,7 @@ Widget bottomnavigationbar(
|
|||||||
height: 28.h,
|
height: 28.h,
|
||||||
width: 28.w,
|
width: 28.w,
|
||||||
),
|
),
|
||||||
label: localizations.translate('Invest'),
|
label: localizations.translate(AppText.investText),
|
||||||
),
|
),
|
||||||
BottomNavigationBarItem(
|
BottomNavigationBarItem(
|
||||||
icon: Image.asset(
|
icon: Image.asset(
|
||||||
@@ -84,7 +85,7 @@ Widget bottomnavigationbar(
|
|||||||
height: 30.h,
|
height: 30.h,
|
||||||
width: 30.w,
|
width: 30.w,
|
||||||
),
|
),
|
||||||
label: localizations.translate('Academy'),
|
label: localizations.translate(AppText.academyText),
|
||||||
),
|
),
|
||||||
BottomNavigationBarItem(
|
BottomNavigationBarItem(
|
||||||
icon: Image.asset(
|
icon: Image.asset(
|
||||||
@@ -97,7 +98,7 @@ Widget bottomnavigationbar(
|
|||||||
height: 30.h,
|
height: 30.h,
|
||||||
width: 30.w,
|
width: 30.w,
|
||||||
),
|
),
|
||||||
label: localizations.translate('Settings'),
|
label: localizations.translate(AppText.settingsText),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ class FormLabelTextField extends StatelessWidget {
|
|||||||
"+974": 8, // Qatar
|
"+974": 8, // Qatar
|
||||||
"+966": 9, // Saudi Arabia
|
"+966": 9, // Saudi Arabia
|
||||||
"+971": 9, // United Arab Emirates
|
"+971": 9, // United Arab Emirates
|
||||||
|
"+91": 10,
|
||||||
};
|
};
|
||||||
var registerBloc = context.read<RegisterBloc>();
|
var registerBloc = context.read<RegisterBloc>();
|
||||||
var loginBloc = context.read<LoginBloc>();
|
var loginBloc = context.read<LoginBloc>();
|
||||||
|
|||||||
@@ -1,11 +1,18 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:gap/gap.dart';
|
import 'package:gap/gap.dart';
|
||||||
import 'package:tanami_app/core/routes/routes.dart';
|
import 'package:tanami_app/core/routes/routes.dart';
|
||||||
import 'package:tanami_app/core/styles/app_color.dart';
|
import 'package:tanami_app/core/styles/app_color.dart';
|
||||||
|
import 'package:tanami_app/core/utils/secure/secure_storage_service.dart';
|
||||||
|
import 'package:tanami_app/features/welcome/presentation/pages/weclome_screen.dart';
|
||||||
import 'package:tanami_app/shared/components/text_widget.dart';
|
import 'package:tanami_app/shared/components/text_widget.dart';
|
||||||
|
|
||||||
|
import 'bloc/language/lng_bloc.dart';
|
||||||
|
import 'bloc/language/lng_event.dart';
|
||||||
|
|
||||||
void showLanguageBottomSheet(BuildContext context) {
|
void showLanguageBottomSheet(BuildContext context) {
|
||||||
|
final SecureStorageService secureStorageService = SecureStorageService();
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
context: context,
|
context: context,
|
||||||
@@ -34,8 +41,16 @@ void showLanguageBottomSheet(BuildContext context) {
|
|||||||
),
|
),
|
||||||
const Gap(10),
|
const Gap(10),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () async {
|
||||||
|
context
|
||||||
|
.read<LocalizationBloc>()
|
||||||
|
.add(const ChangeLanguage(Locale('en')));
|
||||||
|
|
||||||
|
await secureStorageService.write(
|
||||||
|
'languageSelected', "en");
|
||||||
goRouter.pop();
|
goRouter.pop();
|
||||||
|
Navigator.of(context).push(MaterialPageRoute(
|
||||||
|
builder: (_) => const WelcomeScreen()));
|
||||||
},
|
},
|
||||||
child: Center(
|
child: Center(
|
||||||
child:
|
child:
|
||||||
@@ -48,8 +63,16 @@ void showLanguageBottomSheet(BuildContext context) {
|
|||||||
),
|
),
|
||||||
const Gap(10),
|
const Gap(10),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () async {
|
||||||
|
context
|
||||||
|
.read<LocalizationBloc>()
|
||||||
|
.add(const ChangeLanguage(Locale('ar')));
|
||||||
|
|
||||||
|
await secureStorageService.write(
|
||||||
|
'languageSelected', "ar");
|
||||||
goRouter.pop();
|
goRouter.pop();
|
||||||
|
Navigator.of(context).push(MaterialPageRoute(
|
||||||
|
builder: (_) => const WelcomeScreen()));
|
||||||
},
|
},
|
||||||
child: Center(
|
child: Center(
|
||||||
child: TextWidget().text15W700("عربي", clr: Colors.white),
|
child: TextWidget().text15W700("عربي", clr: Colors.white),
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|||||||
import 'package:gap/gap.dart';
|
import 'package:gap/gap.dart';
|
||||||
import 'package:tanami_app/Api_Helper/base_manager.dart';
|
import 'package:tanami_app/Api_Helper/base_manager.dart';
|
||||||
import 'package:tanami_app/core/styles/app_color.dart';
|
import 'package:tanami_app/core/styles/app_color.dart';
|
||||||
|
import 'package:tanami_app/shared/components/loader.dart';
|
||||||
|
|
||||||
import '../../core/routes/route_name.dart';
|
import '../../core/routes/route_name.dart';
|
||||||
import '../../core/routes/routes.dart';
|
import '../../core/routes/routes.dart';
|
||||||
@@ -109,6 +110,7 @@ permissionDialog(
|
|||||||
),
|
),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
|
Loader.loader(context);
|
||||||
Map<String, dynamic> biometricdata = {
|
Map<String, dynamic> biometricdata = {
|
||||||
"token":
|
"token":
|
||||||
await secureStorageService.read("temp_token"),
|
await secureStorageService.read("temp_token"),
|
||||||
@@ -118,16 +120,19 @@ permissionDialog(
|
|||||||
ResponseData response = await RegisterAPIService()
|
ResponseData response = await RegisterAPIService()
|
||||||
.BiometricUpdate(biometricdata);
|
.BiometricUpdate(biometricdata);
|
||||||
if (response.status == ResponseStatus.SUCCESS) {
|
if (response.status == ResponseStatus.SUCCESS) {
|
||||||
await secureStorageService.write("biometric", 'on');
|
goRouter.pop();
|
||||||
}
|
|
||||||
successToastMessage(
|
|
||||||
context, "Biometric/Face Id Enabled Sucessfully !");
|
|
||||||
// successToastMessage(context, "successful !");
|
|
||||||
goRouter.pop();
|
|
||||||
|
|
||||||
goRouter.goNamed(RouteName.pinScreen, pathParameters: {
|
await secureStorageService.write("biometric", 'on');
|
||||||
"fromScreen": "register",
|
successToastMessage(context,
|
||||||
});
|
"Biometric/Face Id Enabled Sucessfully !");
|
||||||
|
// successToastMessage(context, "successful !");
|
||||||
|
goRouter.pop();
|
||||||
|
|
||||||
|
goRouter
|
||||||
|
.goNamed(RouteName.pinScreen, pathParameters: {
|
||||||
|
"fromScreen": "register",
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 48.h,
|
height: 48.h,
|
||||||
|
|||||||
Reference in New Issue
Block a user