fingerprint auth added

This commit is contained in:
jayesh
2024-07-03 18:46:18 +05:30
parent d25048f01d
commit d9c4711cef
28 changed files with 963 additions and 509 deletions

View File

@@ -37,7 +37,21 @@ class GeneralSettingsSection extends StatelessWidget {
clr: AppColor.textLabelColor,
),
BlocProvider(
create: (_) => ToggleBloc(),
create: (_) => ToggleBloc("notification"),
child: const CustomToggle(),
)
],
),
const Gap(15),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
TextWidget().text14W600(
AppText.biometricText,
clr: AppColor.textLabelColor,
),
BlocProvider(
create: (_) => ToggleBloc("biometric"),
child: const CustomToggle(),
)
],

View File

@@ -1,15 +1,12 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:gap/gap.dart';
import 'package:tanami_app/core/styles/app_color.dart';
import 'package:tanami_app/core/styles/app_images.dart';
import 'package:tanami_app/core/styles/app_text.dart';
import 'package:tanami_app/shared/components/bloc/toggle/toggle_bloc.dart';
import 'package:tanami_app/shared/components/text_widget.dart';
import '../../../../../core/routes/route_name.dart';
import '../../../../../core/routes/routes.dart';
import '../../../../../shared/components/toggle_widget.dart';
import 'settings_list_tile_item.dart';
class PrivacySettingsSection extends StatelessWidget {
@@ -29,20 +26,6 @@ class PrivacySettingsSection extends StatelessWidget {
clr: AppColor.hintTextColor,
),
const Gap(5),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
TextWidget().text14W600(
AppText.biometricText,
clr: AppColor.textLabelColor,
),
BlocProvider(
create: (_) => ToggleBloc(),
child: const CustomToggle(),
)
],
),
const Gap(12),
SettingsListItem(
onTapFunc: () {
goRouter.pushNamed(

View File

@@ -34,7 +34,7 @@ class SettingsBottomSection extends StatelessWidget {
),
),
const Gap(5),
Container(
SizedBox(
width: 1.sw,
height: 56.h,
child: ButtonWidget().textBorderBtn(

View File

@@ -1,447 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:tanami_app/core/routes/route_name.dart';
import 'package:tanami_app/core/routes/routes.dart';
import 'package:tanami_app/core/styles/app_text.dart';
class WalletScreen extends StatefulWidget {
const WalletScreen({super.key});
@override
State<WalletScreen> createState() => _WalletScreenState();
}
class _WalletScreenState extends State<WalletScreen> {
List data = [
{
'title': AppText.deposit,
'subTitle': '',
'dateTime': '10/04/2024 22:04',
'value': '+ SAR 100,000',
'subValue': '',
'onHold': false,
},
{
'title': AppText.withdrawal,
'subTitle': '',
'dateTime': '10/04/2024 22:04',
'value': '- SAR 100,000',
'subValue': '',
'onHold': true,
},
{
'title': AppText.investment,
'subTitle': 'Name of Investment',
'dateTime': '10/04/2024 22:04',
'value': '- SAR 100,000',
'subValue': '',
'onHold': false,
},
{
'title': AppText.yield,
'subTitle': 'Name of Investment',
'dateTime': '10/04/2024 22:04',
'value': '+ SAR 100,000',
'subValue': '+ \$100,00',
'onHold': false,
},
{
'title': AppText.refund,
'subTitle': '',
'dateTime': '10/04/2024 22:04',
'value': '- SAR 100,000',
'subValue': '',
'onHold': true,
},
];
@override
void initState() {
// TODO: implement initState
// _savebottomsheet();
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBar(
elevation: 0,
scrolledUnderElevation: 0.0,
automaticallyImplyLeading: false,
toolbarHeight: 260.h,
titleSpacing: 22.w,
title: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
AppText.walletTitle,
style: GoogleFonts.dmSans(
color: const Color(0xFF343434),
fontSize: 14.sp,
fontWeight: FontWeight.w700,
),
),
SizedBox(
height: 4.h,
),
Text(
'SAR 178,000',
style: GoogleFonts.dmSans(
color: const Color(0xFF191B1E),
fontSize: 28.sp,
fontWeight: FontWeight.w700,
),
),
SizedBox(
height: 80.h,
)
],
),
flexibleSpace: FlexibleSpaceBar(
background: Stack(
children: [
Image.asset(
'assets/images/wallet_screen/bg.png', // Replace with your image asset
fit: BoxFit.fitWidth,
alignment: Alignment.topCenter,
),
Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20.0),
child: Container(
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.8),
borderRadius:
const BorderRadius.all(Radius.circular(20.0)),
),
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 20.0, vertical: 20.0),
child: IntrinsicHeight(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
onTap: () {
goRouter.pushNamed(RouteName.depositScreen);
},
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
'assets/images/wallet_screen/deposit.png',
height: 20.h,
),
),
),
Text(
'Deposit',
style: GoogleFonts.dmSans(
color: const Color(0xFF363636),
fontSize: 12.sp,
fontWeight: FontWeight.w700,
),
),
],
),
),
const VerticalDivider(
color: Colors.black,
width: 20.0,
),
GestureDetector(
onTap: () {
goRouter.pushNamed(RouteName.withdrawalScreen);
},
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
'assets/images/wallet_screen/withdraw.png',
height: 20.h,
),
),
),
Text(
'Withdraw',
style: GoogleFonts.dmSans(
color: const Color(0xFF363636),
fontSize: 12.sp,
fontWeight: FontWeight.w700,
),
),
],
),
),
],
),
),
),
),
),
)
],
),
),
backgroundColor: Colors
.transparent, // Make the AppBar transparent to show the background image
),
body: Padding(
padding: const EdgeInsets.fromLTRB(18.0, 10.0, 18.0, 0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
AppText.day,
style: GoogleFonts.dmSans(
color: const Color(0xFF8D8D8D),
fontSize: 11.sp,
fontWeight: FontWeight.w500,
),
),
Row(
children: [
Container(
decoration: const BoxDecoration(
color: Color(0xFFF6F6F6),
borderRadius: BorderRadius.all(Radius.circular(12.0)),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
'assets/images/wallet_screen/search.png',
height: 20.h,
),
),
),
SizedBox(
width: 5.w,
),
GestureDetector(
onTap: () {
goRouter.pushNamed(RouteName.filterScreen);
},
child: Container(
decoration: const BoxDecoration(
color: Color(0xFFF6F6F6),
borderRadius: BorderRadius.all(Radius.circular(12.0)),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
'assets/images/wallet_screen/filter.png',
height: 20.h,
),
),
),
),
],
),
],
),
SizedBox(
height: 10.h,
),
Expanded(
child: ListView.builder(
shrinkWrap: true,
itemCount: data.length,
itemBuilder: (context, index) {
return Padding(
padding: const EdgeInsets.only(bottom: 10.0),
child: GestureDetector(
onTap: () {
goRouter.pushNamed(RouteName.walletDetails,
pathParameters: {
"type": data[index]['title'],
});
},
child: Container(
height: 92.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(22.r),
color: const Color(0xFFF6F6F6),
),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Row(
children: [
getIcon(data[index]['title']),
SizedBox(width: 12.w),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
data[index]['title'],
style: GoogleFonts.dmSans(
color: const Color(0xFF191B1E),
fontSize: 14.sp,
fontWeight: FontWeight.w700,
),
),
SizedBox(height: 4.h),
(data[index]['subTitle'] != '')
? Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
data[index]['subTitle'],
style: GoogleFonts.dmSans(
color: const Color(0xFF191B1E),
fontSize: 14.sp,
fontWeight: FontWeight.w400,
),
),
SizedBox(height: 4.h),
],
)
: Container(),
Text(
data[index]['dateTime'],
style: GoogleFonts.dmSans(
color: const Color(0xFF8D8D8D),
fontSize: 11.sp,
fontWeight: FontWeight.w500,
),
),
],
),
Spacer(),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.center,
children: [
(data[index]['onHold'])
? Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
AppText.onHold,
style: GoogleFonts.dmSans(
color: const Color(0xFF0172CB),
fontSize: 14.sp,
fontWeight: FontWeight.w700,
),
),
SizedBox(height: 4.h),
],
)
: Container(),
Text(
data[index]['value'],
style: GoogleFonts.dmSans(
color: const Color(0xFF191B1E),
fontSize: 14.sp,
fontWeight: FontWeight.w700,
),
),
SizedBox(height: 4.h),
(data[index]['subValue'] != '')
? Text(
data[index]['subValue'],
style: GoogleFonts.dmSans(
color: const Color(0xFF191B1E),
fontSize: 12.sp,
fontWeight: FontWeight.w500,
),
)
: Container(),
],
),
],
),
),
),
),
);
},
),
)
],
),
),
);
}
Widget getIcon(String title) {
if (title == 'Deposit') {
return Container(
decoration: const BoxDecoration(
shape: BoxShape.circle, color: Color(0xFF0FA4A4)),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
'assets/images/wallet_screen/deposit_list.png',
height: 25.h,
),
),
);
} else if (title == 'Withdrawal') {
return Container(
decoration: const BoxDecoration(
shape: BoxShape.circle, color: Color(0xFFE6681F)),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset('assets/images/wallet_screen/withdraw_list.png',
height: 25.h),
),
);
} else if (title == 'Investment') {
return Container(
decoration: const BoxDecoration(
shape: BoxShape.circle, color: Color(0xFF0172CB)),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset('assets/images/wallet_screen/invest_list.png',
height: 25.h),
),
);
} else if (title == 'Yield') {
return Container(
decoration: const BoxDecoration(
shape: BoxShape.circle, color: Color(0xFF4C4AEF)),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset('assets/images/wallet_screen/yield_list.png',
height: 25.h),
),
);
} else {
return Container(
decoration: const BoxDecoration(
shape: BoxShape.circle, color: Color(0xFF0E9445)),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset('assets/images/wallet_screen/refund_list.png',
height: 25.h),
),
);
}
}
}

View File

@@ -0,0 +1,298 @@
import 'package:flutter/material.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 '../../../../../core/routes/route_name.dart';
import '../../../../../core/routes/routes.dart';
import '../../../../../core/styles/app_text.dart';
List data = [
{
'title': AppText.deposit,
'subTitle': '',
'dateTime': '10/04/2024 22:04',
'value': '+ SAR 100,000',
'subValue': '',
'onHold': false,
},
{
'title': AppText.withdrawal,
'subTitle': '',
'dateTime': '10/04/2024 22:04',
'value': '- SAR 100,000',
'subValue': '',
'onHold': true,
},
{
'title': AppText.investment,
'subTitle': 'Name of Investment',
'dateTime': '10/04/2024 22:04',
'value': '- SAR 100,000',
'subValue': '',
'onHold': false,
},
{
'title': AppText.yield,
'subTitle': 'Name of Investment',
'dateTime': '10/04/2024 22:04',
'value': '+ SAR 100,000',
'subValue': '+ \$100,00',
'onHold': false,
},
{
'title': AppText.refund,
'subTitle': '',
'dateTime': '10/04/2024 22:04',
'value': '- SAR 100,000',
'subValue': '',
'onHold': true,
},
];
class WalletLayout extends StatelessWidget {
const WalletLayout({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColor.plainWhite,
body: Padding(
padding: const EdgeInsets.fromLTRB(18.0, 10.0, 18.0, 0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
AppText.day,
style: GoogleFonts.dmSans(
color: const Color(0xFF8D8D8D),
fontSize: 11.sp,
fontWeight: FontWeight.w500,
),
),
Row(
children: [
Container(
decoration: const BoxDecoration(
color: Color(0xFFF6F6F6),
borderRadius: BorderRadius.all(Radius.circular(12.0)),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
'assets/images/wallet_screen/search.png',
height: 20.h,
),
),
),
SizedBox(
width: 5.w,
),
GestureDetector(
onTap: () {
goRouter.pushNamed(RouteName.filterScreen);
},
child: Container(
decoration: const BoxDecoration(
color: Color(0xFFF6F6F6),
borderRadius: BorderRadius.all(Radius.circular(12.0)),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
'assets/images/wallet_screen/filter.png',
height: 20.h,
),
),
),
),
],
),
],
),
SizedBox(
height: 10.h,
),
Expanded(
child: ListView.builder(
shrinkWrap: true,
itemCount: data.length,
itemBuilder: (context, index) {
return Padding(
padding: const EdgeInsets.only(bottom: 10.0),
child: GestureDetector(
onTap: () {
goRouter.pushNamed(RouteName.walletDetails,
pathParameters: {
"type": data[index]['title'],
});
},
child: Container(
height: 92.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(22.r),
color: const Color(0xFFF6F6F6),
),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Row(
children: [
getIcon(data[index]['title']),
SizedBox(width: 12.w),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
data[index]['title'],
style: GoogleFonts.dmSans(
color: const Color(0xFF191B1E),
fontSize: 14.sp,
fontWeight: FontWeight.w700,
),
),
SizedBox(height: 4.h),
(data[index]['subTitle'] != '')
? Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
data[index]['subTitle'],
style: GoogleFonts.dmSans(
color: const Color(0xFF191B1E),
fontSize: 14.sp,
fontWeight: FontWeight.w400,
),
),
SizedBox(height: 4.h),
],
)
: Container(),
Text(
data[index]['dateTime'],
style: GoogleFonts.dmSans(
color: const Color(0xFF8D8D8D),
fontSize: 11.sp,
fontWeight: FontWeight.w500,
),
),
],
),
const Spacer(),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.center,
children: [
(data[index]['onHold'])
? Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
AppText.onHold,
style: GoogleFonts.dmSans(
color: const Color(0xFF0172CB),
fontSize: 14.sp,
fontWeight: FontWeight.w700,
),
),
SizedBox(height: 4.h),
],
)
: Container(),
Text(
data[index]['value'],
style: GoogleFonts.dmSans(
color: const Color(0xFF191B1E),
fontSize: 14.sp,
fontWeight: FontWeight.w700,
),
),
SizedBox(height: 4.h),
(data[index]['subValue'] != '')
? Text(
data[index]['subValue'],
style: GoogleFonts.dmSans(
color: const Color(0xFF191B1E),
fontSize: 12.sp,
fontWeight: FontWeight.w500,
),
)
: Container(),
],
),
],
),
),
),
),
);
},
),
)
],
),
),
);
}
}
Widget getIcon(String title) {
if (title == 'Deposit') {
return Container(
decoration:
const BoxDecoration(shape: BoxShape.circle, color: Color(0xFF0FA4A4)),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
'assets/images/wallet_screen/deposit_list.png',
height: 25.h,
),
),
);
} else if (title == 'Withdrawal') {
return Container(
decoration:
const BoxDecoration(shape: BoxShape.circle, color: Color(0xFFE6681F)),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset('assets/images/wallet_screen/withdraw_list.png',
height: 25.h),
),
);
} else if (title == 'Investment') {
return Container(
decoration:
const BoxDecoration(shape: BoxShape.circle, color: Color(0xFF0172CB)),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset('assets/images/wallet_screen/invest_list.png',
height: 25.h),
),
);
} else if (title == 'Yield') {
return Container(
decoration:
const BoxDecoration(shape: BoxShape.circle, color: Color(0xFF4C4AEF)),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset('assets/images/wallet_screen/yield_list.png',
height: 25.h),
),
);
} else {
return Container(
decoration:
const BoxDecoration(shape: BoxShape.circle, color: Color(0xFF0E9445)),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset('assets/images/wallet_screen/refund_list.png',
height: 25.h),
),
);
}
}

View File

@@ -0,0 +1,166 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:gap/gap.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:tanami_app/core/routes/route_name.dart';
import 'package:tanami_app/core/routes/routes.dart';
import 'package:tanami_app/core/styles/app_text.dart';
import 'wallet_layout.dart';
class WalletScreen extends StatefulWidget {
const WalletScreen({super.key});
@override
State<WalletScreen> createState() => _WalletScreenState();
}
class _WalletScreenState extends State<WalletScreen> {
@override
void initState() {
// _savebottomsheet();
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBar(
elevation: 0,
scrolledUnderElevation: 0.0,
automaticallyImplyLeading: false,
toolbarHeight: 260.h,
titleSpacing: 22.w,
title: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
AppText.walletTitle,
style: GoogleFonts.dmSans(
color: const Color(0xFF343434),
fontSize: 14.sp,
fontWeight: FontWeight.w700,
),
),
Gap(4.h),
Text(
'SAR 178,000',
style: GoogleFonts.dmSans(
color: const Color(0xFF191B1E),
fontSize: 28.sp,
fontWeight: FontWeight.w700,
),
),
Gap(80.h)
],
),
flexibleSpace: FlexibleSpaceBar(
background: Stack(
children: [
Image.asset(
'assets/images/wallet_screen/bg.png', // Replace with your image asset
fit: BoxFit.fitWidth,
alignment: Alignment.topCenter,
),
Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20.0),
child: Container(
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.8),
borderRadius:
const BorderRadius.all(Radius.circular(20.0)),
),
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 20.0, vertical: 20.0),
child: IntrinsicHeight(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
onTap: () {
goRouter.pushNamed(RouteName.depositScreen);
},
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
'assets/images/wallet_screen/deposit.png',
height: 20.h,
),
),
),
Text(
'Deposit',
style: GoogleFonts.dmSans(
color: const Color(0xFF363636),
fontSize: 12.sp,
fontWeight: FontWeight.w700,
),
),
],
),
),
const VerticalDivider(
color: Colors.black,
width: 20.0,
),
GestureDetector(
onTap: () {
goRouter.pushNamed(RouteName.withdrawalScreen);
},
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
'assets/images/wallet_screen/withdraw.png',
height: 20.h,
),
),
),
Text(
'Withdraw',
style: GoogleFonts.dmSans(
color: const Color(0xFF363636),
fontSize: 12.sp,
fontWeight: FontWeight.w700,
),
),
],
),
),
],
),
),
),
),
),
)
],
),
),
backgroundColor: Colors
.transparent, // Make the AppBar transparent to show the background image
),
body: const WalletLayout(),
);
}
}

View File

@@ -4,7 +4,7 @@ import 'package:tanami_app/features/MainScreens/Academy/presentation/pages/acade
import 'package:tanami_app/features/MainScreens/Invest/presentation/pages/invest_screen.dart';
import 'package:tanami_app/features/MainScreens/Portfolio/presentation/pages/portfolio_screen.dart';
import 'package:tanami_app/features/MainScreens/Settings/presentation/pages/settings_Screen.dart';
import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/walletScreen.dart';
import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/wallet_screen.dart';
import 'package:tanami_app/shared/components/common_bottom_navigation.dart';
import '../../shared/components/bloc/bottom_nav_bar/bottom_navigation_bloc.dart';

View File

@@ -1,10 +1,17 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart';
import '../../../../core/routes/route_name.dart';
import '../../../../core/routes/routes.dart';
import '../../../../core/styles/app_images.dart';
import '../../../../core/utils/biometric/biometric_bloc.dart';
import '../../../../core/utils/biometric/biometric_event.dart';
import '../../../../core/utils/biometric/biometric_state.dart';
import '../../../../shared/components/device_locked_dialog.dart';
class BiometricLayout extends StatelessWidget {
const BiometricLayout({super.key});
@@ -19,31 +26,46 @@ class BiometricLayout extends StatelessWidget {
}
return Scaffold(
backgroundColor: Colors.white,
body: SizedBox(
width: 1.sw,
height: 1.sh,
child: Stack(
children: [
Positioned.fill(
child: SvgPicture.asset(
height: 1.sh,
width: 1.sw,
AppImages.biometricBg,
fit: BoxFit.cover,
),
),
Positioned.fill(
child: Align(
alignment: Alignment.center,
child: Image.asset(
biometricImage,
width: 133,
height: 155,
body: BlocConsumer<BiometricBloc, BiometricState>(
listener: (context, state) {
if (state is BiometricChecked && state.canAuthenticate) {
context.read<BiometricBloc>().add(AuthenticateBiometricEvent());
} else if (state is BiometricFailed) {
deviceLockedDialog(context);
} else if (state is BiometricAuthenticated) {
goRouter.goNamed(RouteName.pinScreen, pathParameters: {
"fromScreen": "LoginedInUser",
});
}
},
builder: (context, state) {
return SizedBox(
width: 1.sw,
height: 1.sh,
child: Stack(
children: [
Positioned.fill(
child: SvgPicture.asset(
height: 1.sh,
width: 1.sw,
AppImages.biometricBg,
fit: BoxFit.cover,
),
),
),
Positioned.fill(
child: Align(
alignment: Alignment.center,
child: Image.asset(
biometricImage,
width: 133,
height: 155,
),
),
),
],
),
],
),
);
},
),
);
}

View File

@@ -13,13 +13,13 @@ import 'package:tanami_app/shared/components/checkbox_widget.dart';
import 'package:tanami_app/shared/components/loader.dart';
import 'package:tanami_app/shared/components/toast_message.dart';
import '../../../../core/routes/route_name.dart';
import '../../../../core/routes/routes.dart';
import '../../../../core/styles/app_color.dart';
import '../../../../core/styles/app_text.dart';
import '../../../../shared/components/bloc/checkbox/checkbox_bloc.dart';
import '../../../../shared/components/bloc/checkbox/checkbox_state.dart';
import '../../../../shared/components/button_widget.dart';
import '../../../../shared/components/permission_dialog.dart';
import '../bloc/register_user_bloc.dart';
import '../bloc/register_user_event.dart';
import '../bloc/register_user_state.dart';
@@ -93,12 +93,8 @@ class RegisterUserBottomSection extends StatelessWidget {
if (state is RegisterUserLoading) {
Loader.loader(context);
} else if (state is RegisterUserSuccess) {
successToastMessage(context, "successful !");
goRouter.pop();
goRouter.goNamed(RouteName.pinScreen, pathParameters: {
"fromScreen": "register",
});
permissionDialog(context);
} else if (state is RegisterUserFailure) {
goRouter.pop();
errorToastMessage(

View File

@@ -1,5 +1,6 @@
import 'package:bloc/bloc.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'app_version_event.dart';
import 'app_version_state.dart';

View File

@@ -44,9 +44,14 @@ class SplashScreen extends StatelessWidget {
// Navigate to the WelcomeScreen using the goRouter
goRouter.goNamed(RouteName.welcomeScreen);
} else {
goRouter.goNamed(RouteName.pinScreen, pathParameters: {
"fromScreen": "LoginedInUser",
});
if (await secureStorageService.read('biometric') != null &&
await secureStorageService.read('biometric') == 'on') {
goRouter.goNamed(RouteName.biometricScreen);
} else {
goRouter.goNamed(RouteName.pinScreen, pathParameters: {
"fromScreen": "LoginedInUser",
});
}
}
}
}