diff --git a/lib/core/routes/route_name.dart b/lib/core/routes/route_name.dart index 6caa377..1ab4196 100644 --- a/lib/core/routes/route_name.dart +++ b/lib/core/routes/route_name.dart @@ -68,4 +68,5 @@ class RouteName { //invest static const String investDetailScreen = "investDetailScreen"; static const String investPaymentScreen = "investPaymentScreen"; + static const String confirmInvestScreen = "confirmInvestScreen"; } diff --git a/lib/core/routes/routes.dart b/lib/core/routes/routes.dart index f82d1d7..95c8221 100644 --- a/lib/core/routes/routes.dart +++ b/lib/core/routes/routes.dart @@ -4,6 +4,7 @@ import 'package:go_router/go_router.dart'; import 'package:tanami_app/core/routes/route_name.dart'; import 'package:tanami_app/features/MainScreens/Academy/presentation/pages/academy_details_screen.dart'; import 'package:tanami_app/features/MainScreens/Invest/presentation/pages/invest_details_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/Portfolio/presentation/pages/portfolio_details_screen.dart'; import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/walletDetails.dart'; @@ -230,6 +231,13 @@ final goRouter = GoRouter( return const InvestPaymentScreen(); }, ), + GoRoute( + name: RouteName.confirmInvestScreen, + path: RouteName.confirmInvestScreen, + builder: (context, state) { + return const ConfirmInvestmentScreen(); + }, + ), ], ), ], diff --git a/lib/features/MainScreens/Invest/presentation/pages/payment/confirm_investment_layout.dart b/lib/features/MainScreens/Invest/presentation/pages/payment/confirm_investment_layout.dart new file mode 100644 index 0000000..92955f3 --- /dev/null +++ b/lib/features/MainScreens/Invest/presentation/pages/payment/confirm_investment_layout.dart @@ -0,0 +1,19 @@ +import 'package:flutter/material.dart'; + +import '../../widgets/payment/confirm_invest_bottom_section.dart'; +import '../../widgets/payment/confirm_invest_top_section.dart'; + +class ConfirmInvestmentLayout extends StatelessWidget { + const ConfirmInvestmentLayout({super.key}); + + @override + Widget build(BuildContext context) { + return const Scaffold( + bottomNavigationBar: ConfirmInvestBottomSection(), + body: Padding( + padding: EdgeInsets.all(16.0), + child: ConfirmInvestTopSection(), + ), + ); + } +} diff --git a/lib/features/MainScreens/Invest/presentation/pages/payment/confirm_investment_screen.dart b/lib/features/MainScreens/Invest/presentation/pages/payment/confirm_investment_screen.dart new file mode 100644 index 0000000..2206315 --- /dev/null +++ b/lib/features/MainScreens/Invest/presentation/pages/payment/confirm_investment_screen.dart @@ -0,0 +1,20 @@ +import 'package:flutter/material.dart'; +import 'package:tanami_app/features/MainScreens/Invest/presentation/pages/payment/confirm_investment_layout.dart'; + +import '../../../../../../core/styles/app_text.dart'; +import '../../../../../../shared/components/appbar_widget.dart'; + +class ConfirmInvestmentScreen extends StatelessWidget { + const ConfirmInvestmentScreen({super.key}); + + @override + Widget build(BuildContext context) { + return const Scaffold( + appBar: AppBarWidget( + height: 75, + titleTxt: AppText.confirmInvestmentText, + ), + body: ConfirmInvestmentLayout(), + ); + } +} diff --git a/lib/features/MainScreens/Invest/presentation/widgets/payment/confirm_invest_bottom_section.dart b/lib/features/MainScreens/Invest/presentation/widgets/payment/confirm_invest_bottom_section.dart new file mode 100644 index 0000000..5bd95cc --- /dev/null +++ b/lib/features/MainScreens/Invest/presentation/widgets/payment/confirm_invest_bottom_section.dart @@ -0,0 +1,30 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +import '../../../../../../core/styles/app_color.dart'; +import '../../../../../../core/styles/app_text.dart'; +import '../../../../../../shared/components/button_widget.dart'; + +class ConfirmInvestBottomSection extends StatelessWidget { + const ConfirmInvestBottomSection({ + super.key, + }); + + @override + Widget build(BuildContext context) { + return Container( + margin: const EdgeInsets.symmetric( + horizontal: 16, + vertical: 15, + ), + width: 1.sw, + height: 60.h, + child: ButtonWidget().elevatedBtn( + txtClr: AppColor.plainWhite, + function: () {}, + text: AppText.investText, + clr: AppColor.primaryColor2, + ), + ); + } +} diff --git a/lib/features/MainScreens/Invest/presentation/widgets/payment/confirm_invest_top_section.dart b/lib/features/MainScreens/Invest/presentation/widgets/payment/confirm_invest_top_section.dart new file mode 100644 index 0000000..b1774d2 --- /dev/null +++ b/lib/features/MainScreens/Invest/presentation/widgets/payment/confirm_invest_top_section.dart @@ -0,0 +1,151 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:gap/gap.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/text_widget.dart'; + +class ConfirmInvestTopSection extends StatelessWidget { + const ConfirmInvestTopSection({super.key}); + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + clipBehavior: Clip.antiAlias, + decoration: BoxDecoration( + color: AppColor.plainWhite, + borderRadius: BorderRadius.circular(22.0), + boxShadow: const [ + BoxShadow( + color: Color(0x14000000), + blurRadius: 8, + offset: Offset(-2, -2), + spreadRadius: 0.50, + ), + BoxShadow( + color: Color(0x3391978E), + blurRadius: 8, + offset: Offset(2, 2), + spreadRadius: 4, + ) + ], + ), + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(16.0), + child: Row( + children: [ + ClipRRect( + borderRadius: BorderRadius.circular(4), + child: Image.asset( + 'assets/images/portfolio_screen/detailsbg.png', + width: 0.2.sw, + height: 0.2.sw, + fit: BoxFit.cover, + ), + ), + const Gap(16.0), + Expanded( + child: TextWidget().text17W700( + 'Multi Family Residential', + clr: AppColor.plainBlack, + )), + ], + ), + ), + Container( + decoration: const ShapeDecoration( + color: AppColor.portfolioCardBgColor, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(22), + bottomRight: Radius.circular(22), + ), + ), + ), + child: const Column( + children: [ + Padding( + padding: EdgeInsets.all(12.0), + child: Column( + children: [ + InvestmentDetailRow( + label: AppText.investmentamount, + value: 'SAR 1,000', + subTitle: "\$ 267,00", + ), + SizedBox(height: 8.0), + InvestmentDetailRow( + label: AppText.paymentMethod, + value: 'Wallet', + subTitle: "", + ), + SizedBox(height: 8.0), + InvestmentDetailRow( + label: AppText.currentExchangeText, + value: 'SAR 1 = USD 0.27', + subTitle: "", + ), + SizedBox(height: 8.0), + InvestmentDetailRow( + label: '${AppText.totalDebitedAmountText}:', + value: 'SAR 1,000', + subTitle: "", + ), + ], + ), + ) + ], + ), + ) + ], + ), + ), + ], + ); + } +} + +class InvestmentDetailRow extends StatelessWidget { + final String label; + final String value; + final String subTitle; + + const InvestmentDetailRow({ + super.key, + required this.label, + required this.value, + required this.subTitle, + }); + + @override + Widget build(BuildContext context) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + TextWidget().text14W500( + label, + clr: AppColor.investPaymentTextColor, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + TextWidget().text14W700( + value, + clr: AppColor.plainBlack, + ), + TextWidget().text11W400( + subTitle, + clr: AppColor.plainBlack, + ), + ], + ), + ], + ); + } +} diff --git a/lib/features/MainScreens/Invest/presentation/widgets/payment/invest_pay_bottom_section.dart b/lib/features/MainScreens/Invest/presentation/widgets/payment/invest_pay_bottom_section.dart index 2b09ede..c68a4ef 100644 --- a/lib/features/MainScreens/Invest/presentation/widgets/payment/invest_pay_bottom_section.dart +++ b/lib/features/MainScreens/Invest/presentation/widgets/payment/invest_pay_bottom_section.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:gap/gap.dart'; +import 'package:tanami_app/core/routes/route_name.dart'; import '../../../../../../core/routes/routes.dart'; import '../../../../../../core/styles/app_color.dart'; @@ -45,6 +46,15 @@ class InvestPayBottomSection extends StatelessWidget { // ), // ) // : null; + + // showDialog( + // context: context, + // builder: (context) { + // return const InvestmentOverSubscribedDialog(); + // }, + // ); + + goRouter.pushNamed(RouteName.confirmInvestScreen); }, text: AppText.nextText, clr: diff --git a/lib/features/MainScreens/Invest/presentation/widgets/payment/investment_oversubscribed_dialog.dart b/lib/features/MainScreens/Invest/presentation/widgets/payment/investment_oversubscribed_dialog.dart new file mode 100644 index 0000000..7321729 --- /dev/null +++ b/lib/features/MainScreens/Invest/presentation/widgets/payment/investment_oversubscribed_dialog.dart @@ -0,0 +1,59 @@ +import 'package:flutter/material.dart'; +import 'package:gap/gap.dart'; +import 'package:tanami_app/core/routes/routes.dart'; +import 'package:tanami_app/core/styles/app_color.dart'; +import 'package:tanami_app/core/styles/app_text.dart'; + +import '../../../../../../shared/components/text_widget.dart'; + +class InvestmentOverSubscribedDialog extends StatelessWidget { + const InvestmentOverSubscribedDialog({super.key}); + + @override + Widget build(BuildContext context) { + return AlertDialog( + backgroundColor: AppColor.plainWhite, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(20), + ), + title: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + IconButton( + icon: const Icon( + Icons.close, + color: AppColor.hintTextColor, + ), + onPressed: () { + goRouter.pop(); + }, + ), + TextWidget().text17W700( + AppText.unableToProcessTransactionText, + clr: AppColor.textLabelColor, + ), + ], + ), + content: Column( + mainAxisSize: MainAxisSize.min, + children: [ + TextWidget().text15W500( + AppText.investmentOpportunityHasReachedMaxcapText, + clr: AppColor.hintTextColor, + ), + const Gap(20), + GestureDetector( + onTap: () { + goRouter.pop(); + goRouter.pop(); + goRouter.pop(); + }, + child: TextWidget().text14W500(AppText.backToInvestmentText, + textDecoration: TextDecoration.underline, + clr: AppColor.otpTextColor), + ), + ], + ), + ); + } +} diff --git a/lib/features/MainScreens/Wallet/presentation/pages/walletDetails.dart b/lib/features/MainScreens/Wallet/presentation/pages/walletDetails.dart index e5ed198..ec02a90 100644 --- a/lib/features/MainScreens/Wallet/presentation/pages/walletDetails.dart +++ b/lib/features/MainScreens/Wallet/presentation/pages/walletDetails.dart @@ -234,7 +234,7 @@ class WalletDetails extends StatelessWidget { } else if (type == 'Investment') { return Container( width: double.infinity, - decoration: BoxDecoration( + decoration: const BoxDecoration( border: Border( bottom: BorderSide( color: Colors.white, @@ -306,8 +306,7 @@ class WalletDetails extends StatelessWidget { fontWeight: FontWeight.w500, ), ), - SizedBox( - width: 180.w, + Expanded( child: Text( values[index], textAlign: TextAlign.end, diff --git a/lib/features/MainScreens/Wallet/presentation/pages/withdrawal/confirmation.dart b/lib/features/MainScreens/Wallet/presentation/pages/withdrawal/confirmation.dart index d7d3775..06f3b81 100644 --- a/lib/features/MainScreens/Wallet/presentation/pages/withdrawal/confirmation.dart +++ b/lib/features/MainScreens/Wallet/presentation/pages/withdrawal/confirmation.dart @@ -1,5 +1,4 @@ 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'; @@ -74,7 +73,7 @@ class _WithdrawalConfirmationState extends State { padding: const EdgeInsets.fromLTRB(18.0, 10, 18.0, 0), child: Row( mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Image.asset( 'assets/images/wallet_screen/done.png', @@ -83,8 +82,7 @@ class _WithdrawalConfirmationState extends State { SizedBox( width: 10.w, ), - SizedBox( - width: 320.w, + Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -229,7 +227,7 @@ class _WithdrawalConfirmationState extends State { ), ), (index != titles.length - 1) - ? Divider() + ? const Divider() : Container() ], ); diff --git a/lib/features/MainScreens/Wallet/presentation/pages/withdrawal/preview.dart b/lib/features/MainScreens/Wallet/presentation/pages/withdrawal/preview.dart index f98ae12..31b0b0a 100644 --- a/lib/features/MainScreens/Wallet/presentation/pages/withdrawal/preview.dart +++ b/lib/features/MainScreens/Wallet/presentation/pages/withdrawal/preview.dart @@ -1,5 +1,6 @@ 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'; @@ -61,11 +62,10 @@ class _WithdrawalPreviewState extends State { 'assets/images/wallet_screen/info.png', height: 25.h, ), - SizedBox( - width: 10.w, + Gap( + 10.w, ), - SizedBox( - width: 320.w, + Expanded( child: Text( AppText.info1, style: GoogleFonts.dmSans( @@ -220,12 +220,14 @@ class _WithdrawalPreviewState extends State { SizedBox( width: 10.w, ), - Text( - AppText.info2, - style: GoogleFonts.dmSans( - color: const Color(0xFF015698), - fontSize: 12.sp, - fontWeight: FontWeight.w500, + Expanded( + child: Text( + AppText.info2, + style: GoogleFonts.dmSans( + color: const Color(0xFF015698), + fontSize: 12.sp, + fontWeight: FontWeight.w500, + ), ), ), ], diff --git a/lib/features/MainScreens/Wallet/presentation/pages/withdrawal/withdrawalScreen.dart b/lib/features/MainScreens/Wallet/presentation/pages/withdrawal/withdrawalScreen.dart index e46eac2..f315ce9 100644 --- a/lib/features/MainScreens/Wallet/presentation/pages/withdrawal/withdrawalScreen.dart +++ b/lib/features/MainScreens/Wallet/presentation/pages/withdrawal/withdrawalScreen.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.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'; @@ -123,7 +124,7 @@ class _WithdrawalScreenState extends State { bottomLeft: Radius.circular(22.r), bottomRight: Radius.circular(22.r), ), - color: Color(0xFFD8D8D8).withOpacity(0.4), + color: const Color(0xFFD8D8D8).withOpacity(0.4), ), child: Padding( padding: const EdgeInsets.symmetric( @@ -239,15 +240,17 @@ class _WithdrawalScreenState extends State { 'assets/images/wallet_screen/info.png', height: 25.h, ), - SizedBox( - width: 10.w, + Gap( + 10.w, ), - Text( - AppText.info2, - style: GoogleFonts.dmSans( - color: const Color(0xFF015698), - fontSize: 12.sp, - fontWeight: FontWeight.w500, + Expanded( + child: Text( + AppText.info2, + style: GoogleFonts.dmSans( + color: const Color(0xFF015698), + fontSize: 12.sp, + fontWeight: FontWeight.w500, + ), ), ), ], diff --git a/lib/features/MainScreens/main_screen.dart b/lib/features/MainScreens/main_screen.dart index 584e344..028360d 100644 --- a/lib/features/MainScreens/main_screen.dart +++ b/lib/features/MainScreens/main_screen.dart @@ -4,7 +4,6 @@ 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/kyc.dart'; import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/walletScreen.dart'; import 'package:tanami_app/shared/components/common_bottom_navigation.dart'; @@ -13,8 +12,8 @@ import '../../shared/components/bloc/bottom_nav_bar/bottom_navigation_state.dart import '../../shared/components/exit_app_dialog.dart'; var currentTab = [ - // const WalletScreen(), - const KYCScreen(), + const WalletScreen(), + // const KYCScreen(), const PortfolioScreen(), const InvestScreen(), const AcademyScreen(),