api integration
This commit is contained in:
@@ -16,6 +16,7 @@ class ApiEndpoints {
|
||||
|
||||
//Biometric
|
||||
static const biometricUpdateapi = "${baseurl}auth/public/biometric-update";
|
||||
static const biometricLoginapi = "${baseurl}auth/public/biometric-login";
|
||||
|
||||
//PIN
|
||||
static const confirmpinapi = "${baseurl}auth/public/masterPin";
|
||||
|
||||
@@ -76,6 +76,10 @@ class NetworkApiService {
|
||||
response.data['error']['message'], ResponseStatus.PRIVATE,
|
||||
data: response.data);
|
||||
}
|
||||
} else if (response.statusCode == 401) {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['error']['message'], ResponseStatus.PRIVATE,
|
||||
data: response.data);
|
||||
} else {
|
||||
try {
|
||||
return ResponseData<dynamic>(
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:google_fonts/google_fonts.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 'bloc/bottom_nav_bar/bottom_navigation_bloc.dart';
|
||||
@@ -45,7 +46,7 @@ Widget bottomnavigationbar(
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
),
|
||||
label: localizations.translate('Wallet'),
|
||||
label: localizations.translate(AppText.walletText),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Image.asset(
|
||||
@@ -58,7 +59,7 @@ Widget bottomnavigationbar(
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
),
|
||||
label: localizations.translate('Portfolio'),
|
||||
label: localizations.translate(AppText.portfolioBottomText),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Image.asset(
|
||||
@@ -71,7 +72,7 @@ Widget bottomnavigationbar(
|
||||
height: 28.h,
|
||||
width: 28.w,
|
||||
),
|
||||
label: localizations.translate('Invest'),
|
||||
label: localizations.translate(AppText.investText),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Image.asset(
|
||||
@@ -84,7 +85,7 @@ Widget bottomnavigationbar(
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
),
|
||||
label: localizations.translate('Academy'),
|
||||
label: localizations.translate(AppText.academyText),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Image.asset(
|
||||
@@ -97,7 +98,7 @@ Widget bottomnavigationbar(
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
),
|
||||
label: localizations.translate('Settings'),
|
||||
label: localizations.translate(AppText.settingsText),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -44,6 +44,7 @@ class FormLabelTextField extends StatelessWidget {
|
||||
"+974": 8, // Qatar
|
||||
"+966": 9, // Saudi Arabia
|
||||
"+971": 9, // United Arab Emirates
|
||||
"+91": 10,
|
||||
};
|
||||
var registerBloc = context.read<RegisterBloc>();
|
||||
var loginBloc = context.read<LoginBloc>();
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:tanami_app/core/routes/routes.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 'bloc/language/lng_bloc.dart';
|
||||
import 'bloc/language/lng_event.dart';
|
||||
|
||||
void showLanguageBottomSheet(BuildContext context) {
|
||||
final SecureStorageService secureStorageService = SecureStorageService();
|
||||
showModalBottomSheet(
|
||||
backgroundColor: Colors.transparent,
|
||||
context: context,
|
||||
@@ -34,8 +41,16 @@ void showLanguageBottomSheet(BuildContext context) {
|
||||
),
|
||||
const Gap(10),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
onTap: () async {
|
||||
context
|
||||
.read<LocalizationBloc>()
|
||||
.add(const ChangeLanguage(Locale('en')));
|
||||
|
||||
await secureStorageService.write(
|
||||
'languageSelected', "en");
|
||||
goRouter.pop();
|
||||
Navigator.of(context).push(MaterialPageRoute(
|
||||
builder: (_) => const WelcomeScreen()));
|
||||
},
|
||||
child: Center(
|
||||
child:
|
||||
@@ -48,8 +63,16 @@ void showLanguageBottomSheet(BuildContext context) {
|
||||
),
|
||||
const Gap(10),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
onTap: () async {
|
||||
context
|
||||
.read<LocalizationBloc>()
|
||||
.add(const ChangeLanguage(Locale('ar')));
|
||||
|
||||
await secureStorageService.write(
|
||||
'languageSelected', "ar");
|
||||
goRouter.pop();
|
||||
Navigator.of(context).push(MaterialPageRoute(
|
||||
builder: (_) => const WelcomeScreen()));
|
||||
},
|
||||
child: Center(
|
||||
child: TextWidget().text15W700("عربي", clr: Colors.white),
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:tanami_app/Api_Helper/base_manager.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/routes.dart';
|
||||
@@ -109,6 +110,7 @@ permissionDialog(
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
Loader.loader(context);
|
||||
Map<String, dynamic> biometricdata = {
|
||||
"token":
|
||||
await secureStorageService.read("temp_token"),
|
||||
@@ -118,16 +120,19 @@ permissionDialog(
|
||||
ResponseData response = await RegisterAPIService()
|
||||
.BiometricUpdate(biometricdata);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
await secureStorageService.write("biometric", 'on');
|
||||
}
|
||||
successToastMessage(
|
||||
context, "Biometric/Face Id Enabled Sucessfully !");
|
||||
// successToastMessage(context, "successful !");
|
||||
goRouter.pop();
|
||||
goRouter.pop();
|
||||
|
||||
goRouter.goNamed(RouteName.pinScreen, pathParameters: {
|
||||
"fromScreen": "register",
|
||||
});
|
||||
await secureStorageService.write("biometric", 'on');
|
||||
successToastMessage(context,
|
||||
"Biometric/Face Id Enabled Sucessfully !");
|
||||
// successToastMessage(context, "successful !");
|
||||
goRouter.pop();
|
||||
|
||||
goRouter
|
||||
.goNamed(RouteName.pinScreen, pathParameters: {
|
||||
"fromScreen": "register",
|
||||
});
|
||||
}
|
||||
},
|
||||
child: SizedBox(
|
||||
height: 48.h,
|
||||
|
||||
Reference in New Issue
Block a user