@@ -126,8 +126,8 @@ class AppText {
|
||||
static const String userYourAppPinToLoginEnterTanami =
|
||||
"Use your app PIN to login to enter Tanami";
|
||||
static const String forgotPinCode = "Forgot Pin Code";
|
||||
|
||||
static const String notificationText = "Notification";
|
||||
static const String allowNotificationText = "Allow notification";
|
||||
static const String toRestorePinYouWillBeLoggedOut =
|
||||
"To restore PIN you will be Logged out";
|
||||
static const String allowText = "Allow";
|
||||
@@ -192,6 +192,7 @@ class AppText {
|
||||
'To accomplish payment please use payment details and Reference ID in tour Bank';
|
||||
static const String next = 'Next';
|
||||
static const String depositNoti = 'Create deposit notification';
|
||||
static const String payWithAppleText = 'Pay with Apple Pay';
|
||||
static const String submit = 'Submit request';
|
||||
static const String Submit = 'Submit';
|
||||
static const String submitDeposit = 'Submit deposit';
|
||||
@@ -211,6 +212,7 @@ class AppText {
|
||||
//Settings
|
||||
static const String settingsText = "Settings";
|
||||
static const String experiencedInvestorText = "Experienced investor?";
|
||||
static const String removeInvestmentText = "Remove investment thresholds";
|
||||
static const String upgradeText =
|
||||
"Upgrade your investor status today in a few simple steps to allows investments higher than SAR 200,000";
|
||||
static const String generalText = "General";
|
||||
@@ -290,7 +292,7 @@ class AppText {
|
||||
static const String investmentDetailsText = "Investment details";
|
||||
static const String enterInvestmentAmountText = "Enter investment amount";
|
||||
static const String thisIsUsdInvestmentOpportunityText =
|
||||
"This is a USD investment opportunity. Funds will be converted into USD upon confirmation.";
|
||||
"This is a USD investment opportunity. Funds will be converted into USD at a rate of x upon confirmation";
|
||||
static const String choosePaymentMethodText = "Choose payment method";
|
||||
static const String balanceText = "Balance";
|
||||
static const String applePayText = "Apple Pay";
|
||||
@@ -307,6 +309,7 @@ class AppText {
|
||||
"Upgrade your investor status to increase your investment limit.";
|
||||
static const String currentExchangeText = "Current Exchange";
|
||||
static const String feeText = "Fee";
|
||||
static const String processingFees = "Processing fee";
|
||||
static const String debitedAmountText = "Debited amount";
|
||||
static const String totalInvestmentAmountText = "Total Investment amount";
|
||||
static const String confirmInvestmentText = "Confirm investment";
|
||||
|
||||
@@ -18,3 +18,12 @@ List<String> countryFlag = [
|
||||
AppImages.saudiArabiaflag,
|
||||
AppImages.unitedArabEmiratesFlag,
|
||||
];
|
||||
|
||||
List<String> isoCountryCode = [
|
||||
"+973",
|
||||
"+965",
|
||||
"+968",
|
||||
"+974",
|
||||
"+966",
|
||||
"+971",
|
||||
];
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class CommaTextInputFormatter extends TextInputFormatter {
|
||||
@override
|
||||
TextEditingValue formatEditUpdate(
|
||||
TextEditingValue oldValue, TextEditingValue newValue) {
|
||||
final text = newValue.text;
|
||||
if (text.isEmpty) {
|
||||
return newValue;
|
||||
}
|
||||
final newText = NumberFormat("#,##0", "en_US")
|
||||
.format(int.parse(text.replaceAll(',', '')));
|
||||
return newValue.copyWith(
|
||||
text: newText,
|
||||
selection: TextSelection.collapsed(offset: newText.length),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,11 @@ class InvestPaymentBloc extends Bloc<InvestPaymentEvent, InvestPaymentState> {
|
||||
return formKey;
|
||||
}
|
||||
|
||||
InvestPaymentBloc() : super(const InvestPaymentState(isFormValid: false)) {
|
||||
InvestPaymentBloc()
|
||||
: super(const InvestPaymentState(isFormValid: false, amount: 0)) {
|
||||
on<FormTextChanged>((event, emit) {
|
||||
emit(state.copyWith(isFormValid: event.text.isNotEmpty));
|
||||
final amount = double.tryParse(event.text.replaceAll(',', '')) ?? 0;
|
||||
emit(state.copyWith(isFormValid: event.text.isNotEmpty, amount: amount));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -2,15 +2,23 @@ import 'package:equatable/equatable.dart';
|
||||
|
||||
class InvestPaymentState extends Equatable {
|
||||
final bool isFormValid;
|
||||
final double amount;
|
||||
|
||||
const InvestPaymentState({required this.isFormValid});
|
||||
const InvestPaymentState({
|
||||
required this.isFormValid,
|
||||
required this.amount,
|
||||
});
|
||||
|
||||
InvestPaymentState copyWith({bool? isFormValid}) {
|
||||
InvestPaymentState copyWith({
|
||||
bool? isFormValid,
|
||||
double? amount,
|
||||
}) {
|
||||
return InvestPaymentState(
|
||||
isFormValid: isFormValid ?? this.isFormValid,
|
||||
amount: amount ?? this.amount,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object> get props => [isFormValid];
|
||||
List<Object> get props => [isFormValid, amount];
|
||||
}
|
||||
|
||||
@@ -37,7 +37,9 @@ class InvestDetailsLayout extends StatelessWidget {
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
InvestDetailCarouselView(),
|
||||
InvestDetailCarouselView(
|
||||
type: type,
|
||||
),
|
||||
InvestDetailDetailsSection(
|
||||
type: type,
|
||||
),
|
||||
@@ -48,14 +50,12 @@ class InvestDetailsLayout extends StatelessWidget {
|
||||
20.h,
|
||||
),
|
||||
const KeyInvestmentSection(),
|
||||
Gap(
|
||||
20.h,
|
||||
),
|
||||
const InvestIncludedDocumentsSection(),
|
||||
Gap(
|
||||
20.h,
|
||||
),
|
||||
const InvestVideoSection(),
|
||||
type == "closed" ? const SizedBox() : Gap(20.h),
|
||||
type == "closed"
|
||||
? const SizedBox()
|
||||
: const InvestIncludedDocumentsSection(),
|
||||
type == "closed" ? const SizedBox() : Gap(20.h),
|
||||
type == "closed" ? const SizedBox() : const InvestVideoSection(),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -84,21 +84,21 @@ class InvestClosedDetailsSection extends StatelessWidget {
|
||||
Gap(
|
||||
10.h,
|
||||
),
|
||||
TextWidget()
|
||||
.text22W900("SAR 1,478,000", clr: AppColor.investTextColor),
|
||||
const Gap(8.0),
|
||||
LinearProgressIndicator(
|
||||
value: 1,
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
minHeight: 8.0,
|
||||
backgroundColor: AppColor.txtBorderColor,
|
||||
valueColor: const AlwaysStoppedAnimation<Color>(
|
||||
AppColor.investTextColor),
|
||||
),
|
||||
const Gap(8.0),
|
||||
TextWidget().text11W700("100% ${AppText.fundedText}",
|
||||
clr: AppColor.portoflioCardTextColor),
|
||||
const Gap(8.0),
|
||||
// TextWidget()
|
||||
// .text22W900("SAR 1,478,000", clr: AppColor.investTextColor),
|
||||
// const Gap(8.0),
|
||||
// LinearProgressIndicator(
|
||||
// value: 1,
|
||||
// borderRadius: BorderRadius.circular(2),
|
||||
// minHeight: 8.0,
|
||||
// backgroundColor: AppColor.txtBorderColor,
|
||||
// valueColor: const AlwaysStoppedAnimation<Color>(
|
||||
// AppColor.investTextColor),
|
||||
// ),
|
||||
// const Gap(8.0),
|
||||
// TextWidget().text11W700("100% ${AppText.fundedText}",
|
||||
// clr: AppColor.portoflioCardTextColor),
|
||||
// const Gap(8.0),
|
||||
TextWidget().text14W400(
|
||||
'Forem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur tempus urna at turpis condimentum lobortis.',
|
||||
clr: Colors.grey,
|
||||
|
||||
@@ -28,24 +28,30 @@ class InvestDetailDetailsSection extends StatelessWidget {
|
||||
Gap(
|
||||
10.h,
|
||||
),
|
||||
TextWidget()
|
||||
.text22W900("SAR 1,478,000", clr: AppColor.investTextColor),
|
||||
const Gap(8.0),
|
||||
LinearProgressIndicator(
|
||||
value: type == "closed" ? 1 : 0.6,
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
minHeight: 8.0,
|
||||
backgroundColor: AppColor.txtBorderColor,
|
||||
valueColor: const AlwaysStoppedAnimation<Color>(
|
||||
AppColor.investTextColor),
|
||||
),
|
||||
const Gap(8.0),
|
||||
TextWidget().text11W700(
|
||||
type == "closed"
|
||||
? "100% ${AppText.fundedText}"
|
||||
: "60% ${AppText.fundedText}",
|
||||
clr: AppColor.portoflioCardTextColor),
|
||||
const Gap(8.0),
|
||||
type == "closed"
|
||||
? const SizedBox()
|
||||
: TextWidget().text22W900("SAR 1,478,000",
|
||||
clr: AppColor.investTextColor),
|
||||
type == "closed" ? const SizedBox() : const Gap(8.0),
|
||||
type == "closed"
|
||||
? const SizedBox()
|
||||
: LinearProgressIndicator(
|
||||
value: type == "closed" ? 1 : 0.6,
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
minHeight: 8.0,
|
||||
backgroundColor: AppColor.txtBorderColor,
|
||||
valueColor: const AlwaysStoppedAnimation<Color>(
|
||||
AppColor.investTextColor),
|
||||
),
|
||||
type == "closed" ? const SizedBox() : const Gap(8.0),
|
||||
type == "closed"
|
||||
? const SizedBox()
|
||||
: TextWidget().text11W700(
|
||||
type == "closed"
|
||||
? "100% ${AppText.fundedText}"
|
||||
: "60% ${AppText.fundedText}",
|
||||
clr: AppColor.portoflioCardTextColor),
|
||||
type == "closed" ? const SizedBox() : const Gap(8.0),
|
||||
TextWidget().text14W400(
|
||||
'Forem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur tempus urna at turpis condimentum lobortis.',
|
||||
clr: Colors.grey,
|
||||
@@ -87,29 +93,9 @@ class InvestDetailDetailsSection extends StatelessWidget {
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 8.h,
|
||||
),
|
||||
type == "closed" ? const SizedBox() : SizedBox(height: 8.h),
|
||||
type == "closed"
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 200.w,
|
||||
child: TextWidget().text14W500(
|
||||
"${AppText.originalEstimatedReturnText}:",
|
||||
clr: AppColor.portoflioCardTextColor,
|
||||
txtAlign: TextAlign.start,
|
||||
),
|
||||
),
|
||||
TextWidget().text14W700(
|
||||
'20.0%',
|
||||
clr: AppColor.plainBlack,
|
||||
txtAlign: TextAlign.end,
|
||||
),
|
||||
],
|
||||
)
|
||||
? const SizedBox()
|
||||
: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -142,7 +128,9 @@ class InvestDetailDetailsSection extends StatelessWidget {
|
||||
SizedBox(
|
||||
width: 150.w,
|
||||
child: TextWidget().text14W500(
|
||||
"${AppText.actualEstimatedReturnText}:",
|
||||
type == "closed"
|
||||
? "${AppText.actualReturnToDate}:"
|
||||
: "${AppText.actualEstimatedReturnText}:",
|
||||
clr: AppColor.portoflioCardTextColor,
|
||||
txtAlign: TextAlign.start,
|
||||
),
|
||||
@@ -191,7 +179,9 @@ class InvestDetailDetailsSection extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TextWidget().text14W500(
|
||||
"${AppText.payoutDateText}:",
|
||||
type == "closed"
|
||||
? "${AppText.expectedExitDate}:"
|
||||
: "${AppText.payoutDateText}:",
|
||||
clr: AppColor.portoflioCardTextColor,
|
||||
txtAlign: TextAlign.start,
|
||||
),
|
||||
|
||||
@@ -21,9 +21,11 @@ final List imgList = [
|
||||
];
|
||||
|
||||
class InvestDetailCarouselView extends StatelessWidget {
|
||||
final String type;
|
||||
|
||||
final CarouselController _controller = CarouselController();
|
||||
|
||||
InvestDetailCarouselView({super.key});
|
||||
InvestDetailCarouselView({super.key, required this.type});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -135,7 +137,9 @@ class InvestDetailCarouselView extends StatelessWidget {
|
||||
5.w,
|
||||
),
|
||||
TextWidget().text11W500(
|
||||
'${AppText.closingDateText} Jul 10 2025',
|
||||
type == "closed"
|
||||
? '${AppText.closedDateText} Jul 10 2025'
|
||||
: '${AppText.closingDateText} Jul 10 2025',
|
||||
clr: AppColor.plainBlack,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
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 'package:gap/gap.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:tanami_app/core/routes/route_name.dart';
|
||||
|
||||
import '../../../../../../core/routes/routes.dart';
|
||||
import '../../../../../../core/styles/app_color.dart';
|
||||
import '../../../../../../core/styles/app_images.dart';
|
||||
import '../../../../../../core/styles/app_text.dart';
|
||||
import '../../../../../../shared/components/button_widget.dart';
|
||||
import '../../../../../countrySelection/presentation/bloc/choose_country_bloc.dart';
|
||||
import '../../../../../countrySelection/presentation/bloc/choose_country_state.dart';
|
||||
import '../../bloc/payment/invest_payment_bloc.dart';
|
||||
import '../../bloc/payment/invest_payment_state.dart';
|
||||
|
||||
@@ -21,37 +26,91 @@ class InvestPayBottomSection extends StatelessWidget {
|
||||
children: [
|
||||
BlocBuilder<InvestPaymentBloc, InvestPaymentState>(
|
||||
builder: (context, state) {
|
||||
return Container(
|
||||
margin: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
),
|
||||
width: 1.sw,
|
||||
height: 56.h,
|
||||
child: ButtonWidget().elevatedBtn(
|
||||
txtClr: state.isFormValid
|
||||
? AppColor.plainWhite
|
||||
: AppColor.inactiveBtnTxtColor,
|
||||
function: () {
|
||||
if (state.isFormValid) {
|
||||
goRouter.pushNamed(RouteName.confirmInvestScreen);
|
||||
}
|
||||
},
|
||||
text: AppText.nextText,
|
||||
clr: state.isFormValid
|
||||
? AppColor.primaryColor2
|
||||
: AppColor.inactiveBtnColor),
|
||||
return BlocBuilder<RadioBloc, RadioState>(
|
||||
builder: (context, radioState) {
|
||||
int selectedIndex = 0;
|
||||
if (radioState is RadioSelectionChanged) {
|
||||
selectedIndex = radioState.selectedIndex;
|
||||
}
|
||||
return selectedIndex == 1
|
||||
? InkWell(
|
||||
onTap: () {
|
||||
goRouter.pushNamed(RouteName.walletDetails,
|
||||
pathParameters: {
|
||||
"type": 'confirm-investment',
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
margin: const EdgeInsets.all(10.0),
|
||||
height: 65.h,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(22.r),
|
||||
color: state.isFormValid
|
||||
? AppColor.plainBlack
|
||||
: AppColor.inactiveBtnColor),
|
||||
child: Center(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
AppImages.applePayIcon,
|
||||
color: AppColor.plainWhite,
|
||||
height: 32,
|
||||
width: 32,
|
||||
),
|
||||
const Gap(5),
|
||||
Text(
|
||||
AppText.payWithAppleText,
|
||||
style: GoogleFonts.dmSans(
|
||||
color: state.isFormValid
|
||||
? AppColor.plainWhite
|
||||
: AppColor.inactiveBtnTxtColor,
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
margin: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
),
|
||||
width: 1.sw,
|
||||
height: 56.h,
|
||||
child: ButtonWidget().elevatedBtn(
|
||||
txtClr: state.isFormValid
|
||||
? AppColor.plainWhite
|
||||
: AppColor.inactiveBtnTxtColor,
|
||||
function: () {
|
||||
if (state.isFormValid) {
|
||||
goRouter.pushNamed(RouteName.otpScreen,
|
||||
pathParameters: {
|
||||
"fromScreen": "confirm-investment"
|
||||
});
|
||||
}
|
||||
},
|
||||
text: AppText.confirmInvestmentText,
|
||||
clr: state.isFormValid
|
||||
? AppColor.primaryColor2
|
||||
: AppColor.inactiveBtnColor),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
const Gap(5),
|
||||
ButtonWidget().textBorderBtn(
|
||||
borderClr: AppColor.txtBorderColor,
|
||||
clr: AppColor.plainWhite,
|
||||
function: () {
|
||||
goRouter.pop();
|
||||
},
|
||||
text: AppText.backText,
|
||||
),
|
||||
// const Gap(5),
|
||||
// ButtonWidget().textBorderBtn(
|
||||
// borderClr: AppColor.txtBorderColor,
|
||||
// clr: AppColor.plainWhite,
|
||||
// function: () {
|
||||
// goRouter.pop();
|
||||
// },
|
||||
// text: AppText.backText,
|
||||
// ),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -116,11 +116,11 @@ class InvestPayMethodSection extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
const Icon(
|
||||
Icons.arrow_forward,
|
||||
color: Colors.grey,
|
||||
size: 15,
|
||||
)
|
||||
// const Icon(
|
||||
// Icons.arrow_forward,
|
||||
// color: Colors.grey,
|
||||
// size: 15,
|
||||
// )
|
||||
],
|
||||
),
|
||||
],
|
||||
|
||||
@@ -7,9 +7,13 @@ import 'package:tanami_app/core/styles/app_images.dart';
|
||||
import 'package:tanami_app/core/styles/app_text.dart';
|
||||
import 'package:tanami_app/shared/components/text_widget.dart';
|
||||
|
||||
import '../../../../../../core/utils/text_formatter/comma_input_text_formatter.dart';
|
||||
import '../../../../../../shared/components/text_from_field_widget.dart';
|
||||
import '../../../../../countrySelection/presentation/bloc/choose_country_bloc.dart';
|
||||
import '../../../../../countrySelection/presentation/bloc/choose_country_state.dart';
|
||||
import '../../bloc/payment/invest_payment_bloc.dart';
|
||||
import '../../bloc/payment/invest_payment_event.dart';
|
||||
import '../../bloc/payment/invest_payment_state.dart';
|
||||
|
||||
class InvestPayTopSection extends StatelessWidget {
|
||||
const InvestPayTopSection({super.key});
|
||||
@@ -118,6 +122,9 @@ class InvestPayTopSection extends StatelessWidget {
|
||||
.add(FormTextChanged(
|
||||
text: value));
|
||||
},
|
||||
inputFormatters: [
|
||||
CommaTextInputFormatter()
|
||||
],
|
||||
texttype: TextInputType.number,
|
||||
textEditingController:
|
||||
investPaymentBloc
|
||||
@@ -134,26 +141,37 @@ class InvestPayTopSection extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
const Padding(
|
||||
padding: EdgeInsets.all(12.0),
|
||||
child: Column(
|
||||
children: [
|
||||
InvestmentDetailRow(
|
||||
label: AppText.currentExchangeText,
|
||||
value: 'SAR 1 = USD 0.267',
|
||||
),
|
||||
SizedBox(height: 8.0),
|
||||
InvestmentDetailRow(
|
||||
label: AppText.feeText,
|
||||
value: '3%',
|
||||
),
|
||||
SizedBox(height: 8.0),
|
||||
InvestmentDetailRow(
|
||||
label: '${AppText.totalInvestmentAmountText}:',
|
||||
value: 'SAR 1000',
|
||||
),
|
||||
],
|
||||
),
|
||||
BlocBuilder<RadioBloc, RadioState>(
|
||||
builder: (context, radioState) {
|
||||
int selectedIndex = 0;
|
||||
if (radioState is RadioSelectionChanged) {
|
||||
selectedIndex = radioState.selectedIndex;
|
||||
}
|
||||
return selectedIndex == 0
|
||||
? const SizedBox()
|
||||
: const Padding(
|
||||
padding: EdgeInsets.all(12.0),
|
||||
child: Column(
|
||||
children: [
|
||||
// InvestmentDetailRow(
|
||||
// label: AppText.currentExchangeText,
|
||||
// value: 'SAR 1 = USD 0.267',
|
||||
// ),
|
||||
// SizedBox(height: 8.0),
|
||||
InvestmentDetailRow(
|
||||
label: AppText.processingFees,
|
||||
value: '3%',
|
||||
),
|
||||
SizedBox(height: 8.0),
|
||||
InvestmentDetailRow(
|
||||
label:
|
||||
'${AppText.totalInvestmentAmountText}:',
|
||||
value: 'SAR 1000',
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
@@ -162,37 +180,44 @@ class InvestPayTopSection extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
const Gap(24),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Image.asset(
|
||||
width: 24,
|
||||
height: 24,
|
||||
AppImages.orangenInfoIcon,
|
||||
),
|
||||
const Gap(8),
|
||||
Column(
|
||||
BlocBuilder<InvestPaymentBloc, InvestPaymentState>(
|
||||
builder: (context, state) {
|
||||
if (state.amount >= 200000) {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 0.8.sw,
|
||||
child: TextWidget().text12W500(
|
||||
AppText.retailInvestirCanInvestMaxText,
|
||||
clr: AppColor.infoTextColor,
|
||||
),
|
||||
Image.asset(
|
||||
width: 24,
|
||||
height: 24,
|
||||
AppImages.orangenInfoIcon,
|
||||
),
|
||||
SizedBox(
|
||||
width: 0.8.sw,
|
||||
child: TextWidget().text12W700(
|
||||
AppText.upgradeYourInvestorStatusToIncreaseText,
|
||||
clr: AppColor.infoTextColor,
|
||||
txtDec: TextDecoration.underline,
|
||||
decClr: AppColor.infoTextColor,
|
||||
),
|
||||
const Gap(8),
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 0.8.sw,
|
||||
child: TextWidget().text12W500(
|
||||
AppText.retailInvestirCanInvestMaxText,
|
||||
clr: AppColor.infoTextColor,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 0.8.sw,
|
||||
child: TextWidget().text12W700(
|
||||
AppText.upgradeYourInvestorStatusToIncreaseText,
|
||||
clr: AppColor.infoTextColor,
|
||||
txtDec: TextDecoration.underline,
|
||||
decClr: AppColor.infoTextColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return const SizedBox();
|
||||
}
|
||||
}),
|
||||
const Gap(15),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
||||
@@ -73,9 +73,7 @@ class PortfolioLayout extends StatelessWidget {
|
||||
AppText.portfolioText,
|
||||
clr: const Color(0xFFC9D9CB),
|
||||
),
|
||||
Gap(
|
||||
8.h,
|
||||
),
|
||||
Gap(8.h),
|
||||
TextWidget().text28W700(
|
||||
'SAR 178,000',
|
||||
),
|
||||
|
||||
@@ -69,10 +69,10 @@ class DetailsSection extends StatelessWidget {
|
||||
clr: AppColor.plainBlack,
|
||||
txtAlign: TextAlign.end,
|
||||
),
|
||||
TextWidget().text11W400(
|
||||
' \$ 26,700',
|
||||
clr: AppColor.plainBlack,
|
||||
),
|
||||
// TextWidget().text11W400(
|
||||
// ' \$ 26,700',
|
||||
// clr: AppColor.plainBlack,
|
||||
// ),
|
||||
],
|
||||
)
|
||||
],
|
||||
@@ -100,10 +100,10 @@ class DetailsSection extends StatelessWidget {
|
||||
clr: AppColor.plainBlack,
|
||||
txtAlign: TextAlign.end,
|
||||
),
|
||||
TextWidget().text11W400(
|
||||
' \$ 26,700',
|
||||
clr: AppColor.plainBlack,
|
||||
),
|
||||
// TextWidget().text11W400(
|
||||
// ' \$ 26,700',
|
||||
// clr: AppColor.plainBlack,
|
||||
// ),
|
||||
],
|
||||
)
|
||||
],
|
||||
@@ -131,7 +131,7 @@ class DetailsSection extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 22.h,
|
||||
height: 8.h,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
|
||||
@@ -122,10 +122,10 @@ class ExitedCard extends StatelessWidget {
|
||||
portfolioModel.investmentAmountSAR,
|
||||
clr: AppColor.plainBlack,
|
||||
),
|
||||
TextWidget().text11W400(
|
||||
'\$ ${portfolioModel.investmentAmountUSD}',
|
||||
clr: AppColor.plainBlack,
|
||||
),
|
||||
// TextWidget().text11W400(
|
||||
// '\$ ${portfolioModel.investmentAmountUSD}',
|
||||
// clr: AppColor.plainBlack,
|
||||
// ),
|
||||
],
|
||||
)
|
||||
],
|
||||
@@ -148,10 +148,10 @@ class ExitedCard extends StatelessWidget {
|
||||
portfolioModel.currentValuationSAR,
|
||||
clr: AppColor.plainBlack,
|
||||
),
|
||||
TextWidget().text11W400(
|
||||
'\$ ${portfolioModel.currentValuationUSD}',
|
||||
clr: AppColor.plainBlack,
|
||||
),
|
||||
// TextWidget().text11W400(
|
||||
// '\$ ${portfolioModel.currentValuationUSD}',
|
||||
// clr: AppColor.plainBlack,
|
||||
// ),
|
||||
],
|
||||
)
|
||||
],
|
||||
|
||||
@@ -122,10 +122,10 @@ class PendingCard extends StatelessWidget {
|
||||
portfolioModel.investmentAmountSAR,
|
||||
clr: AppColor.plainBlack,
|
||||
),
|
||||
TextWidget().text11W400(
|
||||
' \$ ${portfolioModel.investmentAmountUSD}',
|
||||
clr: AppColor.plainBlack,
|
||||
),
|
||||
// TextWidget().text11W400(
|
||||
// ' \$ ${portfolioModel.investmentAmountUSD}',
|
||||
// clr: AppColor.plainBlack,
|
||||
// ),
|
||||
],
|
||||
)
|
||||
],
|
||||
@@ -148,10 +148,10 @@ class PendingCard extends StatelessWidget {
|
||||
portfolioModel.currentValuationSAR,
|
||||
clr: AppColor.plainBlack,
|
||||
),
|
||||
TextWidget().text11W400(
|
||||
' \$ ${portfolioModel.currentValuationUSD}',
|
||||
clr: AppColor.plainBlack,
|
||||
),
|
||||
// TextWidget().text11W400(
|
||||
// ' \$ ${portfolioModel.currentValuationUSD}',
|
||||
// clr: AppColor.plainBlack,
|
||||
// ),
|
||||
],
|
||||
)
|
||||
],
|
||||
|
||||
@@ -33,7 +33,7 @@ class GeneralSettingsSection extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
TextWidget().text14W600(
|
||||
AppText.notificationText,
|
||||
AppText.allowNotificationText,
|
||||
clr: AppColor.textLabelColor,
|
||||
),
|
||||
BlocProvider(
|
||||
|
||||
@@ -49,7 +49,7 @@ Widget kycCard() {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TextWidget().text14W600(
|
||||
AppText.experiencedInvestorText,
|
||||
AppText.removeInvestmentText,
|
||||
clr: AppColor.kycCardTextColor,
|
||||
),
|
||||
TextWidget().text11W500(
|
||||
|
||||
@@ -13,9 +13,18 @@ class DepositPaymentBloc
|
||||
return formKey;
|
||||
}
|
||||
|
||||
DepositPaymentBloc() : super(const DepositPaymentState(isFormValid: false)) {
|
||||
DepositPaymentBloc()
|
||||
: super(const DepositPaymentState(isFormValid: false, amount: '0')) {
|
||||
on<FormTextChanged>((event, emit) {
|
||||
emit(state.copyWith(isFormValid: event.text.isNotEmpty));
|
||||
final isFormValid = event.text.isNotEmpty;
|
||||
emit(state.copyWith(
|
||||
isFormValid: isFormValid,
|
||||
amount: event.text.isEmpty ? "0" : event.text));
|
||||
});
|
||||
|
||||
// Ensure the listener is added in the constructor
|
||||
amountController.addListener(() {
|
||||
add(FormTextChanged(text: amountController.text));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -2,15 +2,17 @@ import 'package:equatable/equatable.dart';
|
||||
|
||||
class DepositPaymentState extends Equatable {
|
||||
final bool isFormValid;
|
||||
final String amount;
|
||||
|
||||
const DepositPaymentState({required this.isFormValid});
|
||||
const DepositPaymentState({required this.isFormValid, this.amount = '0'});
|
||||
|
||||
DepositPaymentState copyWith({bool? isFormValid}) {
|
||||
DepositPaymentState copyWith({bool? isFormValid, String? amount}) {
|
||||
return DepositPaymentState(
|
||||
isFormValid: isFormValid ?? this.isFormValid,
|
||||
amount: amount ?? this.amount,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object> get props => [isFormValid];
|
||||
List<Object> get props => [isFormValid, amount];
|
||||
}
|
||||
|
||||
@@ -3,13 +3,18 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
import '../../../../../../core/routes/route_name.dart';
|
||||
import '../../../../../../core/routes/routes.dart';
|
||||
import '../../../../../../core/styles/app_color.dart';
|
||||
import '../../../../../../core/styles/app_images.dart';
|
||||
import '../../../../../../core/styles/app_text.dart';
|
||||
import '../../../../../../core/utils/text_formatter/comma_input_text_formatter.dart';
|
||||
import '../../../../../countrySelection/presentation/bloc/choose_country_bloc.dart';
|
||||
import '../../../../../countrySelection/presentation/bloc/choose_country_state.dart';
|
||||
import '../../bloc/deposit/deposit_payment_bloc.dart';
|
||||
import '../../bloc/deposit/deposit_payment_event.dart';
|
||||
import '../../bloc/deposit/deposit_payment_state.dart';
|
||||
@@ -25,37 +30,80 @@ class DepositLayout extends StatelessWidget {
|
||||
return Scaffold(
|
||||
bottomNavigationBar: BlocBuilder<DepositPaymentBloc, DepositPaymentState>(
|
||||
builder: (context, state) {
|
||||
return Padding(
|
||||
padding: MediaQuery.of(context).viewInsets,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
if (state.isFormValid) {
|
||||
goRouter.pushNamed(RouteName.depositPreview);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
margin: const EdgeInsets.all(10.0),
|
||||
height: 65.h,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(22.r),
|
||||
color: state.isFormValid
|
||||
? AppColor.primaryColor2
|
||||
: AppColor.inactiveBtnColor),
|
||||
child: Center(
|
||||
child: Text(
|
||||
AppText.depositNoti,
|
||||
style: GoogleFonts.dmSans(
|
||||
color: state.isFormValid
|
||||
? AppColor.plainWhite
|
||||
: AppColor.inactiveBtnTxtColor,
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
return BlocBuilder<RadioBloc, RadioState>(
|
||||
builder: (context, radioState) {
|
||||
int selectedIndex = 0;
|
||||
if (radioState is RadioSelectionChanged) {
|
||||
selectedIndex = radioState.selectedIndex;
|
||||
}
|
||||
return Padding(
|
||||
padding: MediaQuery.of(context).viewInsets,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
if (state.isFormValid) {
|
||||
goRouter.pushNamed(RouteName.depositPreview);
|
||||
}
|
||||
},
|
||||
child: selectedIndex == 1
|
||||
? Container(
|
||||
margin: const EdgeInsets.all(10.0),
|
||||
height: 65.h,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(22.r),
|
||||
color: state.isFormValid
|
||||
? AppColor.plainBlack
|
||||
: AppColor.inactiveBtnColor),
|
||||
child: Center(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
AppImages.applePayIcon,
|
||||
color: AppColor.plainWhite,
|
||||
height: 32,
|
||||
width: 32,
|
||||
),
|
||||
const Gap(5),
|
||||
Text(
|
||||
AppText.payWithAppleText,
|
||||
style: GoogleFonts.dmSans(
|
||||
color: state.isFormValid
|
||||
? AppColor.plainWhite
|
||||
: AppColor.inactiveBtnTxtColor,
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
margin: const EdgeInsets.all(10.0),
|
||||
height: 65.h,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(22.r),
|
||||
color: state.isFormValid
|
||||
? AppColor.primaryColor2
|
||||
: AppColor.inactiveBtnColor),
|
||||
child: Center(
|
||||
child: Text(
|
||||
AppText.depositNoti,
|
||||
style: GoogleFonts.dmSans(
|
||||
color: state.isFormValid
|
||||
? AppColor.plainWhite
|
||||
: AppColor.inactiveBtnTxtColor,
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -91,217 +139,226 @@ class DepositLayout extends StatelessWidget {
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(22.r),
|
||||
color: Colors.white,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.15),
|
||||
spreadRadius: 2,
|
||||
blurRadius: 10,
|
||||
offset: const Offset(0, 5),
|
||||
BlocBuilder<DepositPaymentBloc, DepositPaymentState>(
|
||||
builder: (context, state) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(22.r),
|
||||
color: Colors.white,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.15),
|
||||
spreadRadius: 2,
|
||||
blurRadius: 10,
|
||||
offset: const Offset(0, 5),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Color(0xFF0FA4A4)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Image.asset(
|
||||
'assets/images/wallet_screen/deposit_list.png',
|
||||
height: 36.h,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Color(0xFF0FA4A4)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Image.asset(
|
||||
'assets/images/wallet_screen/deposit_list.png',
|
||||
height: 36.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 12.w,
|
||||
),
|
||||
Text(
|
||||
AppText.depositTitle,
|
||||
style: GoogleFonts.dmSans(
|
||||
color: Colors.black,
|
||||
fontSize: 17.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFD8D8D8).withOpacity(0.4),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 16.0, horizontal: 12.0),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'SAR',
|
||||
style: GoogleFonts.dmSans(
|
||||
color: const Color(0xFF363636),
|
||||
fontSize: 15.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
SizedBox(
|
||||
width: 12.w,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 12.w,
|
||||
),
|
||||
SizedBox(
|
||||
width: 280.w,
|
||||
child: TextFormField(
|
||||
validator: (value) {
|
||||
if (depositPaymentBloc
|
||||
.amountController.text.isEmpty) {
|
||||
return AppText.pleaseEnterAmountText;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
onChanged: (value) {
|
||||
context
|
||||
.read<DepositPaymentBloc>()
|
||||
.add(FormTextChanged(text: value));
|
||||
},
|
||||
controller: depositPaymentBloc.amountController,
|
||||
cursorColor: Colors.black,
|
||||
keyboardType: TextInputType.number,
|
||||
textAlign: TextAlign.center,
|
||||
Text(
|
||||
AppText.depositTitle,
|
||||
style: GoogleFonts.dmSans(
|
||||
color: Colors.black,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontSize: 17.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
hintText: '1000',
|
||||
hintStyle: GoogleFonts.dmSans(
|
||||
color: const Color(0xFFC6C6C6),
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
labelStyle:
|
||||
const TextStyle(color: Colors.black),
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
vertical: 15, horizontal: 10),
|
||||
filled: true,
|
||||
fillColor: Colors.white,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.white, width: 1),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.white, width: 1),
|
||||
),
|
||||
disabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.white, width: 1),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.white, width: 1),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.red, width: 1),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.red, width: 1),
|
||||
),
|
||||
),
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.deny(
|
||||
RegExp(r'\s')),
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFD8D8D8).withOpacity(0.4),
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.circular(22.r),
|
||||
bottomRight: Radius.circular(22.r),
|
||||
),
|
||||
border: const Border(
|
||||
top: BorderSide(color: Color(0xFFD8D8D8), width: 2.0),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 16.0, horizontal: 12.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFD8D8D8).withOpacity(0.4),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 16.0, horizontal: 12.0),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
AppText.feeText,
|
||||
'SAR',
|
||||
style: GoogleFonts.dmSans(
|
||||
color: const Color(0xFF535353),
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: const Color(0xFF363636),
|
||||
fontSize: 15.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'3%',
|
||||
style: GoogleFonts.dmSans(
|
||||
color: Colors.black,
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
SizedBox(
|
||||
width: 12.w,
|
||||
),
|
||||
SizedBox(
|
||||
width: 280.w,
|
||||
child: TextFormField(
|
||||
inputFormatters: [
|
||||
CommaTextInputFormatter(),
|
||||
FilteringTextInputFormatter.deny(
|
||||
RegExp(r'\s')),
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
],
|
||||
validator: (value) {
|
||||
if (depositPaymentBloc
|
||||
.amountController.text.isEmpty) {
|
||||
return AppText.pleaseEnterAmountText;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
onChanged: (value) {
|
||||
depositPaymentBloc
|
||||
.add(FormTextChanged(text: value));
|
||||
},
|
||||
controller:
|
||||
depositPaymentBloc.amountController,
|
||||
cursorColor: Colors.black,
|
||||
keyboardType: TextInputType.number,
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.dmSans(
|
||||
color: Colors.black,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
hintText: '1000',
|
||||
hintStyle: GoogleFonts.dmSans(
|
||||
color: const Color(0xFFC6C6C6),
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
labelStyle:
|
||||
const TextStyle(color: Colors.black),
|
||||
contentPadding:
|
||||
const EdgeInsets.symmetric(
|
||||
vertical: 15, horizontal: 10),
|
||||
filled: true,
|
||||
fillColor: Colors.white,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.white, width: 1),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.white, width: 1),
|
||||
),
|
||||
disabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.white, width: 1),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.white, width: 1),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.red, width: 1),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.red, width: 1),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFD8D8D8).withOpacity(0.4),
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.circular(22.r),
|
||||
bottomRight: Radius.circular(22.r),
|
||||
),
|
||||
border: const Border(
|
||||
top: BorderSide(
|
||||
color: Color(0xFFD8D8D8), width: 2.0),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 16.0, horizontal: 12.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
AppText.depositAmt,
|
||||
style: GoogleFonts.dmSans(
|
||||
color: const Color(0xFF535353),
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
AppText.processingFees,
|
||||
style: GoogleFonts.dmSans(
|
||||
color: const Color(0xFF535353),
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'3%',
|
||||
style: GoogleFonts.dmSans(
|
||||
color: Colors.black,
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
'SAR 253',
|
||||
style: GoogleFonts.dmSans(
|
||||
color: Colors.black,
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
AppText.depositAmt,
|
||||
style: GoogleFonts.dmSans(
|
||||
color: const Color(0xFF535353),
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'SAR ${state.amount}',
|
||||
style: GoogleFonts.dmSans(
|
||||
color: Colors.black,
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
const Gap(30),
|
||||
const DepositPayMethodSection(),
|
||||
|
||||
@@ -3,10 +3,10 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:tanami_app/core/routes/routes.dart';
|
||||
import 'package:tanami_app/core/styles/app_text.dart';
|
||||
import 'package:ticket_widget/ticket_widget.dart';
|
||||
import 'package:tanami_app/core/styles/app_color.dart';
|
||||
import 'package:tanami_app/core/styles/app_text.dart';
|
||||
import 'package:tanami_app/shared/components/button_widget.dart';
|
||||
import 'package:ticket_widget/ticket_widget.dart';
|
||||
|
||||
class WalletDetails extends StatelessWidget {
|
||||
final String type;
|
||||
@@ -54,8 +54,8 @@ class WalletDetails extends StatelessWidget {
|
||||
goRouter.pop();
|
||||
goRouter.pop();
|
||||
goRouter.pop();
|
||||
goRouter.pop();
|
||||
goRouter.pop();
|
||||
// goRouter.pop();
|
||||
// goRouter.pop();
|
||||
},
|
||||
text: AppText.closeText,
|
||||
clr: AppColor.primaryColor2,
|
||||
@@ -71,8 +71,8 @@ class WalletDetails extends StatelessWidget {
|
||||
goRouter.pop();
|
||||
goRouter.pop();
|
||||
goRouter.pop();
|
||||
goRouter.pop();
|
||||
goRouter.pop();
|
||||
// goRouter.pop();
|
||||
// goRouter.pop();
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.close_sharp,
|
||||
@@ -165,14 +165,14 @@ class WalletDetails extends StatelessWidget {
|
||||
fontWeight: FontWeight.w900,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"+ \$100.00",
|
||||
style: GoogleFonts.dmSans(
|
||||
color: const Color(0xFF363636),
|
||||
fontSize: 12.sp,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
// Text(
|
||||
// "+ \$100.00",
|
||||
// style: GoogleFonts.dmSans(
|
||||
// color: const Color(0xFF363636),
|
||||
// fontSize: 12.sp,
|
||||
// fontWeight: FontWeight.w500,
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
|
||||
@@ -32,28 +32,31 @@ class _WalletScreenState extends State<WalletScreen> {
|
||||
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,
|
||||
title: Padding(
|
||||
padding: const EdgeInsets.only(left: 40.0),
|
||||
child: 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(8.h),
|
||||
Text(
|
||||
'SAR 178,000',
|
||||
style: GoogleFonts.dmSans(
|
||||
color: const Color(0xFF191B1E),
|
||||
fontSize: 28.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
Gap(80.h)
|
||||
],
|
||||
Gap(80.h)
|
||||
],
|
||||
),
|
||||
),
|
||||
flexibleSpace: FlexibleSpaceBar(
|
||||
background: Stack(
|
||||
|
||||
@@ -7,6 +7,8 @@ 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 '../../../../../../core/utils/text_formatter/comma_input_text_formatter.dart';
|
||||
|
||||
class WithdrawalScreen extends StatefulWidget {
|
||||
const WithdrawalScreen({super.key});
|
||||
|
||||
@@ -129,81 +131,109 @@ class _WithdrawalScreenState extends State<WithdrawalScreen> {
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 16.0, horizontal: 12.0),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'SAR',
|
||||
style: GoogleFonts.dmSans(
|
||||
color: const Color(0xFF363636),
|
||||
fontSize: 15.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 12.w,
|
||||
),
|
||||
SizedBox(
|
||||
width: 280.w,
|
||||
child: TextFormField(
|
||||
cursorColor: Colors.black,
|
||||
keyboardType: TextInputType.number,
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.dmSans(
|
||||
color: Colors.black,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
hintText: '1000',
|
||||
hintStyle: GoogleFonts.dmSans(
|
||||
color: const Color(0xFFC6C6C6),
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
labelStyle:
|
||||
const TextStyle(color: Colors.black),
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
vertical: 15, horizontal: 10),
|
||||
filled: true,
|
||||
fillColor: Colors.white,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.white, width: 1),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.white, width: 1),
|
||||
),
|
||||
disabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.white, width: 1),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.white, width: 1),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.red, width: 1),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.red, width: 1),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'SAR',
|
||||
style: GoogleFonts.dmSans(
|
||||
color: const Color(0xFF363636),
|
||||
fontSize: 15.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.deny(
|
||||
RegExp(r'\s')),
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
width: 12.w,
|
||||
),
|
||||
SizedBox(
|
||||
width: 280.w,
|
||||
child: TextFormField(
|
||||
cursorColor: Colors.black,
|
||||
keyboardType: TextInputType.number,
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.dmSans(
|
||||
color: Colors.black,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
hintText: '1000',
|
||||
hintStyle: GoogleFonts.dmSans(
|
||||
color: const Color(0xFFC6C6C6),
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
labelStyle:
|
||||
const TextStyle(color: Colors.black),
|
||||
contentPadding:
|
||||
const EdgeInsets.symmetric(
|
||||
vertical: 15, horizontal: 10),
|
||||
filled: true,
|
||||
fillColor: Colors.white,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.white, width: 1),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.white, width: 1),
|
||||
),
|
||||
disabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.white, width: 1),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.white, width: 1),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.red, width: 1),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.red, width: 1),
|
||||
),
|
||||
),
|
||||
inputFormatters: [
|
||||
CommaTextInputFormatter(),
|
||||
FilteringTextInputFormatter.deny(
|
||||
RegExp(r'\s')),
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const Gap(12),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
AppText.processingFees,
|
||||
style: GoogleFonts.dmSans(
|
||||
color: const Color(0xFF535353),
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'BHD 0.500',
|
||||
style: GoogleFonts.dmSans(
|
||||
color: Colors.black,
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -215,51 +245,51 @@ class _WithdrawalScreenState extends State<WithdrawalScreen> {
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(22.r),
|
||||
color: const Color(0xFFEEF6FB),
|
||||
border: Border.all(color: const Color(0xFF90D4FF)),
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Color(0xFFB0D3EF),
|
||||
spreadRadius: 1,
|
||||
blurRadius: 10,
|
||||
offset: Offset(0, 3),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 12.0, horizontal: 16.0),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/images/wallet_screen/info.png',
|
||||
height: 25.h,
|
||||
),
|
||||
Gap(
|
||||
10.w,
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
AppText.info2,
|
||||
style: GoogleFonts.dmSans(
|
||||
color: const Color(0xFF015698),
|
||||
fontSize: 12.sp,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
// Container(
|
||||
// width: double.infinity,
|
||||
// decoration: BoxDecoration(
|
||||
// borderRadius: BorderRadius.circular(22.r),
|
||||
// color: const Color(0xFFEEF6FB),
|
||||
// border: Border.all(color: const Color(0xFF90D4FF)),
|
||||
// boxShadow: const [
|
||||
// BoxShadow(
|
||||
// color: Color(0xFFB0D3EF),
|
||||
// spreadRadius: 1,
|
||||
// blurRadius: 10,
|
||||
// offset: Offset(0, 3),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// child: Padding(
|
||||
// padding: const EdgeInsets.symmetric(
|
||||
// vertical: 12.0, horizontal: 16.0),
|
||||
// child: Row(
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
// children: [
|
||||
// Image.asset(
|
||||
// 'assets/images/wallet_screen/info.png',
|
||||
// height: 25.h,
|
||||
// ),
|
||||
// Gap(
|
||||
// 10.w,
|
||||
// ),
|
||||
// Expanded(
|
||||
// child: Text(
|
||||
// AppText.info2,
|
||||
// style: GoogleFonts.dmSans(
|
||||
// color: const Color(0xFF015698),
|
||||
// fontSize: 12.sp,
|
||||
// fontWeight: FontWeight.w500,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// SizedBox(
|
||||
// height: 20.h,
|
||||
// ),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(22.r),
|
||||
|
||||
@@ -180,7 +180,6 @@ class DepositPayMethodSection extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
// const Gap(16),
|
||||
]);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -27,8 +27,8 @@ class MainScreen extends StatelessWidget {
|
||||
const MainScreen({super.key});
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
context.read<BottomNavigationBloc>().add(TabChanged(1));
|
||||
final PageController pageController = PageController(initialPage: 1);
|
||||
context.read<BottomNavigationBloc>().add(TabChanged(2));
|
||||
final PageController pageController = PageController(initialPage: 2);
|
||||
|
||||
return BlocBuilder<BottomNavigationBloc, BottomNavigationState>(
|
||||
builder: (context, state) {
|
||||
|
||||
@@ -8,9 +8,9 @@ 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 '../bloc/biometric_bloc.dart';
|
||||
import '../bloc/biometric_event.dart';
|
||||
import '../bloc/biometric_state.dart';
|
||||
import '../../../../shared/components/device_locked_dialog.dart';
|
||||
|
||||
class BiometricLayout extends StatelessWidget {
|
||||
|
||||
@@ -30,7 +30,7 @@ class RestorePasswordPhoneVerificationBloc extends Bloc<
|
||||
// Simulate API call
|
||||
await Future.delayed(const Duration(seconds: 2));
|
||||
// Replace the next line with actual API call
|
||||
final isSuccess = await _mockLoginApi(event.phoneNumber);
|
||||
const isSuccess = true;
|
||||
if (isSuccess) {
|
||||
emit(RestorePasswordPhoneVerificationSuccess());
|
||||
} else {
|
||||
|
||||
@@ -26,6 +26,8 @@ class RestorePasswordPhoneVerificationForm extends StatelessWidget {
|
||||
selectedCountry = state.selectedIndex;
|
||||
restorePasswordBloc.countrySelectionTextField.text =
|
||||
countryName[selectedCountry];
|
||||
restorePasswordBloc.phoneNumberTextField.text =
|
||||
"${isoCountryCode[selectedCountry]} ";
|
||||
}
|
||||
}, builder: (context, state) {
|
||||
int selectedCountry = -1;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:bloc/bloc.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'login_event.dart';
|
||||
import 'login_state.dart';
|
||||
|
||||
@@ -71,7 +72,7 @@ class LoginBloc extends Bloc<LoginEvent, LoginState> {
|
||||
String password,
|
||||
String countryResidence,
|
||||
) async {
|
||||
return phoneNumber == "1234567891" && password == "123456";
|
||||
return password == "123456";
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -25,6 +25,8 @@ class LoginForm extends StatelessWidget {
|
||||
if (state is RadioSelectionChanged) {
|
||||
selectedCountry = state.selectedIndex;
|
||||
loginBloc.countrySelectionTextField.text = countryName[selectedCountry];
|
||||
loginBloc.phoneNumberTextField.text =
|
||||
"${isoCountryCode[selectedCountry]} ";
|
||||
}
|
||||
}, builder: (context, state) {
|
||||
int selectedCountry = -1;
|
||||
|
||||
@@ -20,6 +20,8 @@ class RegisterForm extends StatelessWidget {
|
||||
if (state is RadioSelectionChanged) {
|
||||
selectedCountry = state.selectedIndex;
|
||||
loginBloc.countrySelectionTextField.text = countryName[selectedCountry];
|
||||
loginBloc.phoneNumberTextField.text =
|
||||
"${isoCountryCode[selectedCountry]} ";
|
||||
}
|
||||
}, builder: (context, state) {
|
||||
if (state is RadioSelectionChanged) {
|
||||
|
||||
@@ -44,14 +44,14 @@ class SplashScreen extends StatelessWidget {
|
||||
// Navigate to the WelcomeScreen using the goRouter
|
||||
goRouter.goNamed(RouteName.welcomeScreen);
|
||||
} else {
|
||||
if (await secureStorageService.read('biometric') != null &&
|
||||
await secureStorageService.read('biometric') == 'on') {
|
||||
goRouter.goNamed(RouteName.biometricScreen);
|
||||
} 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",
|
||||
});
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,12 +3,11 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:local_auth/local_auth.dart';
|
||||
import 'package:statsfl/statsfl.dart';
|
||||
|
||||
import 'core/routes/routes.dart';
|
||||
import 'core/utils/biometric/biometric_bloc.dart';
|
||||
import 'core/utils/biometric/biometric_event.dart';
|
||||
import 'core/utils/connectivity/network_connectivity.dart';
|
||||
import 'features/biometric/presentation/bloc/biometric_bloc.dart';
|
||||
import 'features/biometric/presentation/bloc/biometric_event.dart';
|
||||
import 'features/countrySelection/presentation/bloc/choose_country_bloc.dart';
|
||||
import 'shared/components/bloc/bottom_nav_bar/bottom_navigation_bloc.dart';
|
||||
|
||||
@@ -29,16 +28,18 @@ Future<void> main() async {
|
||||
// Set the preferred orientations of the device.
|
||||
SystemChrome.setPreferredOrientations([
|
||||
DeviceOrientation.portraitUp,
|
||||
]).then((value) => runApp(StatsFl(
|
||||
isEnabled: true, //Toggle on/off
|
||||
width: 200, //Set size
|
||||
height: 50, //
|
||||
maxFps: 60, // Support custom FPS target (default is 60)
|
||||
showText: true, // Hide text label
|
||||
sampleTime: .5, //Interval between fps calculations, in seconds.
|
||||
totalTime: 15, //Total length of timeline, in seconds.
|
||||
align: Alignment.center, //Alignment of statsbox
|
||||
child: const MyApp())));
|
||||
]).then((value) => runApp(const MyApp()
|
||||
// StatsFl(
|
||||
// isEnabled: true, //Toggle on/off
|
||||
// width: 200, //Set size
|
||||
// height: 50, //
|
||||
// maxFps: 60, // Support custom FPS target (default is 60)
|
||||
// showText: true, // Hide text label
|
||||
// sampleTime: .5, //Interval between fps calculations, in seconds.
|
||||
// totalTime: 15, //Total length of timeline, in seconds.
|
||||
// align: Alignment.center, //Alignment of statsbox
|
||||
// child: const MyApp())
|
||||
));
|
||||
}
|
||||
|
||||
class MyApp extends StatefulWidget {
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'bottom_navigation_state.dart';
|
||||
// Bloc
|
||||
class BottomNavigationBloc
|
||||
extends Bloc<BottomNavigationEvent, BottomNavigationState> {
|
||||
BottomNavigationBloc() : super(TabState(1)) {
|
||||
BottomNavigationBloc() : super(TabState(2)) {
|
||||
// Register the event handler
|
||||
on<TabChanged>((event, emit) {
|
||||
emit(TabState(event.index));
|
||||
|
||||
@@ -6,10 +6,10 @@ 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/styles/app_text.dart';
|
||||
import 'package:tanami_app/core/utils/biometric/biometric_bloc.dart';
|
||||
import 'package:tanami_app/features/biometric/presentation/bloc/biometric_bloc.dart';
|
||||
|
||||
import '../../core/utils/biometric/biometric_event.dart';
|
||||
import '../../core/utils/biometric/biometric_state.dart';
|
||||
import '../../features/biometric/presentation/bloc/biometric_event.dart';
|
||||
import '../../features/biometric/presentation/bloc/biometric_state.dart';
|
||||
import 'text_widget.dart';
|
||||
|
||||
deviceLockedDialog(
|
||||
|
||||
@@ -85,7 +85,7 @@ buildprofilelogoutdialog(context) {
|
||||
Gap(28.w),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
context.read<BottomNavigationBloc>().add(TabChanged(1));
|
||||
context.read<BottomNavigationBloc>().add(TabChanged(2));
|
||||
await secureStorageService.write('isLoginedIn', "false");
|
||||
goRouter.goNamed(RouteName.loginScreen, pathParameters: {
|
||||
"fromScreen": "registerStep",
|
||||
|
||||
Reference in New Issue
Block a user