Compare commits
12 Commits
2a14fdeb77
...
d25048f01d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d25048f01d | ||
|
|
2df5346ec9 | ||
|
|
07149dcb86 | ||
|
|
9f6dae3bc1 | ||
|
|
4f3d1b196f | ||
|
|
0a6dc94253 | ||
|
|
0147426e85 | ||
|
|
c44b8b2f5e | ||
|
|
074d780086 | ||
|
|
6a02b799df | ||
|
|
ded04e7b64 | ||
|
|
bc0478c134 |
@@ -7,7 +7,7 @@ import 'package:tanami_app/features/MainScreens/Invest/presentation/pages/invest
|
|||||||
import 'package:tanami_app/features/MainScreens/Invest/presentation/pages/payment/confirm_investment_screen.dart';
|
import 'package:tanami_app/features/MainScreens/Invest/presentation/pages/payment/confirm_investment_screen.dart';
|
||||||
import 'package:tanami_app/features/MainScreens/Invest/presentation/pages/payment/invest_payment_screen.dart';
|
import 'package:tanami_app/features/MainScreens/Invest/presentation/pages/payment/invest_payment_screen.dart';
|
||||||
import 'package:tanami_app/features/MainScreens/Portfolio/presentation/pages/portfolio_details_screen.dart';
|
import 'package:tanami_app/features/MainScreens/Portfolio/presentation/pages/portfolio_details_screen.dart';
|
||||||
import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/deposit/depositScreen.dart';
|
import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/deposit/deposit_screen.dart';
|
||||||
import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/deposit/preview.dart';
|
import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/deposit/preview.dart';
|
||||||
import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/filter_screen.dart';
|
import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/filter_screen.dart';
|
||||||
import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/walletDetails.dart';
|
import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/walletDetails.dart';
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class AppText {
|
|||||||
static const String chooseCountry = "Choose country";
|
static const String chooseCountry = "Choose country";
|
||||||
static const String phoneNumber = "Phone number";
|
static const String phoneNumber = "Phone number";
|
||||||
static const String password = "Password";
|
static const String password = "Password";
|
||||||
static const String enterPassword = "Enter password";
|
static const String enterPassword = "Enter Password";
|
||||||
static const String invalidPhoneNo = "Invalid phone number";
|
static const String invalidPhoneNo = "Invalid phone number";
|
||||||
static const String enterPhoneNo = "Enter phone number";
|
static const String enterPhoneNo = "Enter phone number";
|
||||||
static const String invalidPassword = "Invalid password";
|
static const String invalidPassword = "Invalid password";
|
||||||
@@ -156,7 +156,7 @@ class AppText {
|
|||||||
static const String previewTitle = "Withdrawal confirmation";
|
static const String previewTitle = "Withdrawal confirmation";
|
||||||
static const String info =
|
static const String info =
|
||||||
'Your withdrawal request has been received and is currently being processed.';
|
'Your withdrawal request has been received and is currently being processed.';
|
||||||
static const String info1 =
|
static const String info1 =
|
||||||
'Please confirm the withdrawal amount and verify the accuracy of your bank details.';
|
'Please confirm the withdrawal amount and verify the accuracy of your bank details.';
|
||||||
static const String workingDays =
|
static const String workingDays =
|
||||||
'Processing times vary from 3-7 working days';
|
'Processing times vary from 3-7 working days';
|
||||||
@@ -273,6 +273,7 @@ class AppText {
|
|||||||
static const String balanceText = "Balance";
|
static const String balanceText = "Balance";
|
||||||
static const String applePayText = "Apple Pay";
|
static const String applePayText = "Apple Pay";
|
||||||
static const String gPayText = "Gpay Pay";
|
static const String gPayText = "Gpay Pay";
|
||||||
|
static const String bankTransferText = "Directly transfer funds from your bank account into your Tanami wallet.";
|
||||||
static const String instantTransferFundsApplePayText =
|
static const String instantTransferFundsApplePayText =
|
||||||
"Instant transfer of funds using Apple Pay!";
|
"Instant transfer of funds using Apple Pay!";
|
||||||
static const String instantTransferFundsGpayPayText =
|
static const String instantTransferFundsGpayPayText =
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import 'package:bloc/bloc.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'deposit_payment_event.dart';
|
||||||
|
import 'deposit_payment_state.dart';
|
||||||
|
|
||||||
|
class DepositPaymentBloc
|
||||||
|
extends Bloc<DepositPaymentEvent, DepositPaymentState> {
|
||||||
|
final GlobalKey<FormState> formKey = GlobalKey<FormState>();
|
||||||
|
TextEditingController amountController = TextEditingController();
|
||||||
|
|
||||||
|
GlobalKey<FormState> getFormKey() {
|
||||||
|
return formKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
DepositPaymentBloc() : super(const DepositPaymentState(isFormValid: false)) {
|
||||||
|
on<FormTextChanged>((event, emit) {
|
||||||
|
emit(state.copyWith(isFormValid: event.text.isNotEmpty));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> close() {
|
||||||
|
amountController.dispose();
|
||||||
|
|
||||||
|
return super.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import 'package:equatable/equatable.dart';
|
||||||
|
|
||||||
|
abstract class DepositPaymentEvent extends Equatable {
|
||||||
|
const DepositPaymentEvent();
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object> get props => [];
|
||||||
|
}
|
||||||
|
|
||||||
|
class FormTextChanged extends DepositPaymentEvent {
|
||||||
|
final String text;
|
||||||
|
|
||||||
|
const FormTextChanged({required this.text});
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object> get props => [text];
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import 'package:equatable/equatable.dart';
|
||||||
|
|
||||||
|
class DepositPaymentState extends Equatable {
|
||||||
|
final bool isFormValid;
|
||||||
|
|
||||||
|
const DepositPaymentState({required this.isFormValid});
|
||||||
|
|
||||||
|
DepositPaymentState copyWith({bool? isFormValid}) {
|
||||||
|
return DepositPaymentState(
|
||||||
|
isFormValid: isFormValid ?? this.isFormValid,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object> get props => [isFormValid];
|
||||||
|
}
|
||||||
@@ -4,41 +4,61 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
|||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:gap/gap.dart';
|
import 'package:gap/gap.dart';
|
||||||
import 'package:google_fonts/google_fonts.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 'package:tanami_app/features/countrySelection/presentation/bloc/choose_country_bloc.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 '../../bloc/deposit/deposit_payment_bloc.dart';
|
||||||
|
import '../../bloc/deposit/deposit_payment_event.dart';
|
||||||
|
import '../../bloc/deposit/deposit_payment_state.dart';
|
||||||
import '../../widgets/deposit_pay_method_section.dart';
|
import '../../widgets/deposit_pay_method_section.dart';
|
||||||
|
|
||||||
class DepositScreen extends StatefulWidget {
|
class DepositLayout extends StatelessWidget {
|
||||||
const DepositScreen({super.key});
|
const DepositLayout({super.key});
|
||||||
|
|
||||||
@override
|
|
||||||
State<DepositScreen> createState() => _DepositScreenState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _DepositScreenState extends State<DepositScreen> {
|
|
||||||
int selectedIndex = 0;
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
context.read<RadioBloc>();
|
final depositPaymentBloc = context.read<DepositPaymentBloc>();
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Colors.white,
|
bottomNavigationBar: BlocBuilder<DepositPaymentBloc, DepositPaymentState>(
|
||||||
appBar: AppBar(
|
builder: (context, state) {
|
||||||
backgroundColor: Colors.white,
|
return Padding(
|
||||||
elevation: 0,
|
padding: MediaQuery.of(context).viewInsets,
|
||||||
scrolledUnderElevation: 0.0,
|
child: GestureDetector(
|
||||||
centerTitle: true,
|
onTap: () {
|
||||||
title: Text(
|
if (state.isFormValid) {
|
||||||
AppText.depositScreenTitle,
|
goRouter.pushNamed(RouteName.depositPreview);
|
||||||
style: GoogleFonts.dmSans(
|
}
|
||||||
color: const Color(0xFF272727),
|
},
|
||||||
fontSize: 20.sp,
|
child: Container(
|
||||||
fontWeight: FontWeight.w700,
|
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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
|
backgroundColor: AppColor.plainWhite,
|
||||||
body: SingleChildScrollView(
|
body: SingleChildScrollView(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(18.0),
|
padding: const EdgeInsets.all(18.0),
|
||||||
@@ -141,6 +161,19 @@ class _DepositScreenState extends State<DepositScreen> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
width: 280.w,
|
width: 280.w,
|
||||||
child: TextFormField(
|
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,
|
cursorColor: Colors.black,
|
||||||
keyboardType: TextInputType.number,
|
keyboardType: TextInputType.number,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
@@ -276,33 +309,6 @@ class _DepositScreenState extends State<DepositScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
bottomNavigationBar: Padding(
|
|
||||||
padding: MediaQuery.of(context).viewInsets,
|
|
||||||
child: GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
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: const Color(0xFF004717),
|
|
||||||
),
|
|
||||||
child: Center(
|
|
||||||
child: Text(
|
|
||||||
AppText.depositNoti,
|
|
||||||
style: GoogleFonts.dmSans(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 14.sp,
|
|
||||||
fontWeight: FontWeight.w700,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
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_text.dart';
|
||||||
|
import 'package:tanami_app/features/MainScreens/Wallet/presentation/bloc/deposit/deposit_payment_bloc.dart';
|
||||||
|
import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/deposit/deposit_layout.dart';
|
||||||
|
|
||||||
|
class DepositScreen extends StatefulWidget {
|
||||||
|
const DepositScreen({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<DepositScreen> createState() => _DepositScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _DepositScreenState extends State<DepositScreen> {
|
||||||
|
int selectedIndex = 0;
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
appBar: AppBar(
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
elevation: 0,
|
||||||
|
scrolledUnderElevation: 0.0,
|
||||||
|
centerTitle: true,
|
||||||
|
title: Text(
|
||||||
|
AppText.depositScreenTitle,
|
||||||
|
style: GoogleFonts.dmSans(
|
||||||
|
color: const Color(0xFF272727),
|
||||||
|
fontSize: 20.sp,
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
body: MultiBlocProvider(
|
||||||
|
providers: [
|
||||||
|
BlocProvider(
|
||||||
|
// Create an instance of the OnboardingBloc
|
||||||
|
create: (context) => DepositPaymentBloc(),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
child: const DepositLayout(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:gap/gap.dart';
|
import 'package:gap/gap.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
|
||||||
import 'package:tanami_app/core/styles/app_images.dart';
|
import 'package:tanami_app/core/styles/app_images.dart';
|
||||||
import 'package:tanami_app/core/styles/app_text.dart';
|
import 'package:tanami_app/core/styles/app_text.dart';
|
||||||
import 'package:tanami_app/shared/components/text_widget.dart';
|
import 'package:tanami_app/shared/components/text_widget.dart';
|
||||||
@@ -84,43 +83,17 @@ class DepositPayMethodSection extends StatelessWidget {
|
|||||||
const Gap(5),
|
const Gap(5),
|
||||||
SvgPicture.asset(AppImages.walletIcon),
|
SvgPicture.asset(AppImages.walletIcon),
|
||||||
const Gap(5),
|
const Gap(5),
|
||||||
TextWidget().text14W700(AppText.walletText,
|
TextWidget().text14W700(AppText.bankTransfer,
|
||||||
clr: AppColor.textLabelColor),
|
clr: AppColor.textLabelColor),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
RichText(
|
|
||||||
text: TextSpan(
|
|
||||||
children: [
|
|
||||||
TextSpan(
|
|
||||||
text: '${AppText.balanceText}: ',
|
|
||||||
style: GoogleFonts.dmSans(
|
|
||||||
color: Colors.grey,
|
|
||||||
fontSize: 12.0,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
TextSpan(
|
|
||||||
text: 'SAR 178,000',
|
|
||||||
style: GoogleFonts.dmSans(
|
|
||||||
color: Colors.black,
|
|
||||||
fontSize: 14.0,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(12),
|
padding: const EdgeInsets.all(12),
|
||||||
child: TextWidget().text14W500(
|
child: TextWidget().text14W500(
|
||||||
"condimentum ac, vestibulum eu nisl.torquent per conubia nostra, per inceptos himenaeos.",
|
AppText.bankTransferText,
|
||||||
clr: AppColor.textLabelColor,
|
clr: AppColor.textLabelColor,
|
||||||
txtAlign: TextAlign.start,
|
txtAlign: TextAlign.start,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import '../../../../core/styles/app_text.dart';
|
|||||||
import '../../../../shared/components/bloc/checkbox/checkbox_bloc.dart';
|
import '../../../../shared/components/bloc/checkbox/checkbox_bloc.dart';
|
||||||
import '../../../../shared/components/bloc/checkbox/checkbox_state.dart';
|
import '../../../../shared/components/bloc/checkbox/checkbox_state.dart';
|
||||||
import '../../../../shared/components/button_widget.dart';
|
import '../../../../shared/components/button_widget.dart';
|
||||||
import '../../../../shared/components/text_widget.dart';
|
|
||||||
import '../bloc/register_user_bloc.dart';
|
import '../bloc/register_user_bloc.dart';
|
||||||
import '../bloc/register_user_event.dart';
|
import '../bloc/register_user_event.dart';
|
||||||
import '../bloc/register_user_state.dart';
|
import '../bloc/register_user_state.dart';
|
||||||
@@ -166,13 +165,14 @@ class RegisterUserBottomSection extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
const Gap(5),
|
const Gap(5),
|
||||||
ButtonWidget().textBtn(
|
ButtonWidget().textBorderBtn(
|
||||||
function: () {
|
clr: AppColor.plainWhite,
|
||||||
goRouter.pop();
|
function: () {
|
||||||
},
|
goRouter.pop();
|
||||||
text: TextWidget().text14W700(AppText.backText,
|
},
|
||||||
clr: AppColor.textLabelColor,
|
text: AppText.backText,
|
||||||
textDecoration: TextDecoration.underline)),
|
borderClr: AppColor.txtBorderColor,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user