Compare commits

...

12 Commits

Author SHA1 Message Date
jayesh
d25048f01d Merge branch 'main' of https://github.com/WDI-Ideas/Tanami_App into jayeshjain25 2024-06-24 11:11:41 +05:30
meet2711
2df5346ec9 Merge pull request #75 from WDI-Ideas/meet
bugs solvedd
2024-06-21 19:50:40 +05:30
meet2711
07149dcb86 bugs solvedd 2024-06-21 19:50:19 +05:30
jayesh
9f6dae3bc1 ui fixing 2024-06-21 15:36:44 +05:30
jayesh
4f3d1b196f Merge branch 'main' of https://github.com/WDI-Ideas/Tanami_App into jayeshjain25 2024-06-21 14:43:05 +05:30
meet2711
0a6dc94253 Merge pull request #74 from WDI-Ideas/meet
bugs solved
2024-06-21 13:34:48 +05:30
meet2711
0147426e85 bugs solved 2024-06-21 13:34:24 +05:30
jayesh
c44b8b2f5e Merge branch 'main' of https://github.com/WDI-Ideas/Tanami_App into jayeshjain25 2024-06-21 10:40:18 +05:30
meet2711
074d780086 Merge pull request #73 from WDI-Ideas/meet
text fixed
2024-06-20 19:21:08 +05:30
meet2711
6a02b799df text fixed 2024-06-20 19:20:50 +05:30
jayesh
ded04e7b64 Merge branch 'main' of https://github.com/WDI-Ideas/Tanami_App into jayeshjain25 2024-06-20 17:27:21 +05:30
jayesh
bc0478c134 Merge branch 'main' of https://github.com/WDI-Ideas/Tanami_App into jayeshjain25 2024-06-20 17:26:47 +05:30
9 changed files with 182 additions and 94 deletions

View File

@@ -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/invest_payment_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/filter_screen.dart';
import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/walletDetails.dart';

View File

@@ -25,7 +25,7 @@ class AppText {
static const String chooseCountry = "Choose country";
static const String phoneNumber = "Phone number";
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 enterPhoneNo = "Enter phone number";
static const String invalidPassword = "Invalid password";
@@ -156,7 +156,7 @@ class AppText {
static const String previewTitle = "Withdrawal confirmation";
static const String info =
'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.';
static const String workingDays =
'Processing times vary from 3-7 working days';
@@ -273,6 +273,7 @@ class AppText {
static const String balanceText = "Balance";
static const String applePayText = "Apple 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 =
"Instant transfer of funds using Apple Pay!";
static const String instantTransferFundsGpayPayText =

View File

@@ -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();
}
}

View File

@@ -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];
}

View File

@@ -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];
}

View File

@@ -4,41 +4,61 @@ import 'package:flutter_bloc/flutter_bloc.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 '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';
class DepositScreen extends StatefulWidget {
const DepositScreen({super.key});
class DepositLayout extends StatelessWidget {
const DepositLayout({super.key});
@override
State<DepositScreen> createState() => _DepositScreenState();
}
class _DepositScreenState extends State<DepositScreen> {
int selectedIndex = 0;
@override
Widget build(BuildContext context) {
context.read<RadioBloc>();
final depositPaymentBloc = context.read<DepositPaymentBloc>();
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,
),
),
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,
),
),
),
),
),
);
},
),
backgroundColor: AppColor.plainWhite,
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(18.0),
@@ -141,6 +161,19 @@ class _DepositScreenState extends State<DepositScreen> {
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,
@@ -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,
),
),
),
),
),
),
);
}
}

View File

@@ -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(),
),
);
}
}

View File

@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.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/styles/app_images.dart';
import 'package:tanami_app/core/styles/app_text.dart';
import 'package:tanami_app/shared/components/text_widget.dart';
@@ -84,43 +83,17 @@ class DepositPayMethodSection extends StatelessWidget {
const Gap(5),
SvgPicture.asset(AppImages.walletIcon),
const Gap(5),
TextWidget().text14W700(AppText.walletText,
TextWidget().text14W700(AppText.bankTransfer,
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: const EdgeInsets.all(12),
child: TextWidget().text14W500(
"condimentum ac, vestibulum eu nisl.torquent per conubia nostra, per inceptos himenaeos.",
AppText.bankTransferText,
clr: AppColor.textLabelColor,
txtAlign: TextAlign.start,
),

View File

@@ -20,7 +20,6 @@ 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/text_widget.dart';
import '../bloc/register_user_bloc.dart';
import '../bloc/register_user_event.dart';
import '../bloc/register_user_state.dart';
@@ -166,13 +165,14 @@ class RegisterUserBottomSection extends StatelessWidget {
},
),
const Gap(5),
ButtonWidget().textBtn(
function: () {
goRouter.pop();
},
text: TextWidget().text14W700(AppText.backText,
clr: AppColor.textLabelColor,
textDecoration: TextDecoration.underline)),
ButtonWidget().textBorderBtn(
clr: AppColor.plainWhite,
function: () {
goRouter.pop();
},
text: AppText.backText,
borderClr: AppColor.txtBorderColor,
),
],
);
}