From f840d120148246e1acea233559c511f337e44ae7 Mon Sep 17 00:00:00 2001 From: meet2711 Date: Wed, 12 Jun 2024 16:03:39 +0530 Subject: [PATCH] deposit done 2 --- lib/core/routes/route_name.dart | 1 + lib/core/routes/routes.dart | 8 + lib/core/styles/app_text.dart | 17 +- .../presentation/pages/deposit/preview.dart | 4 +- .../presentation/pages/filterScreen.dart | 276 ++++++++++++++++++ .../presentation/pages/walletScreen.dart | 35 ++- 6 files changed, 323 insertions(+), 18 deletions(-) create mode 100644 lib/features/MainScreens/Wallet/presentation/pages/filterScreen.dart diff --git a/lib/core/routes/route_name.dart b/lib/core/routes/route_name.dart index 2109211..1dd7da7 100644 --- a/lib/core/routes/route_name.dart +++ b/lib/core/routes/route_name.dart @@ -34,6 +34,7 @@ class RouteName { //Wallet details static const String walletDetails = 'walletDetails'; + static const String filterScreen = 'filterScreen'; static const String withdrawalScreen = 'withdrawalScreen'; static const String withdrawalPreview = 'withdrawalPreview'; static const String withdrawalConfirmation = 'withdrawalConfirmation'; diff --git a/lib/core/routes/routes.dart b/lib/core/routes/routes.dart index 9e28029..ed6e1cf 100644 --- a/lib/core/routes/routes.dart +++ b/lib/core/routes/routes.dart @@ -8,6 +8,7 @@ import 'package:tanami_app/features/MainScreens/Invest/presentation/pages/paymen 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/preview.dart'; +import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/filterScreen.dart'; import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/walletDetails.dart'; import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/withdrawal/confirmation.dart'; import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/withdrawal/preview.dart'; @@ -169,6 +170,13 @@ final goRouter = GoRouter( type: state.pathParameters["type"]!, ); }), + GoRoute( + name: RouteName.filterScreen, + path: RouteName.filterScreen, + builder: (context, state) { + return const FilterScreen(); + }, + ), GoRoute( name: RouteName.withdrawalScreen, path: RouteName.withdrawalScreen, diff --git a/lib/core/styles/app_text.dart b/lib/core/styles/app_text.dart index 579545d..920856d 100644 --- a/lib/core/styles/app_text.dart +++ b/lib/core/styles/app_text.dart @@ -131,7 +131,13 @@ class AppText { static const String walletTitle = "Wallet balance"; static const String walletText = "Wallet"; static const String day = "Today"; + static const String filterTitle = "Filters"; static const String onHold = "On hold"; + static const String deposit = "Deposit"; + static const String withdrawal = "Withdrawal"; + static const String yield = "Yield"; + static const String refund = "REfund"; + static const String investment = "Investment"; static const String walletDetailsTitle = "Details"; static const String withdrawalScreenTitle = 'Enter bank details'; static const String depositScreenTitle = 'Deposit notification'; @@ -158,16 +164,25 @@ class AppText { static const String withdrawAmt = 'Total Withdrawal amount:'; static const String depositAmt = 'Total Deposit amount:'; static const String info2 = 'Payment can include transfer fee from your bank'; - static const String info3 = 'To accomplish payment please use payment details and Reference ID in tour Bank'; + static const String info3 = + '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 submit = 'Submit request'; + static const String Submit = 'Submit'; static const String submitDeposit = 'Submit deposit'; static const String cont = 'Continue'; static const String later = 'Later'; static const String back = 'Back to change'; + static const String clear = 'Clear All'; static const String bankTransfer = 'Bank Transfer'; static const String amtTrans = 'Amount of transaction'; + static const String date1 = 'Newest first'; + static const String date2 = 'Oldest first'; + static const String all = 'All'; + static const String byDate = 'By date'; + static const String byAction = 'By type of action'; + static const String byStatus = 'By status'; //Settings static const String settingsText = "Settings"; diff --git a/lib/features/MainScreens/Wallet/presentation/pages/deposit/preview.dart b/lib/features/MainScreens/Wallet/presentation/pages/deposit/preview.dart index 16131ab..8efd565 100644 --- a/lib/features/MainScreens/Wallet/presentation/pages/deposit/preview.dart +++ b/lib/features/MainScreens/Wallet/presentation/pages/deposit/preview.dart @@ -398,7 +398,7 @@ class _DepositPreviewState extends State { ), ), ), - Gap(10), + const Gap(10), GestureDetector( onTap: () { Navigator.pop(context); @@ -409,7 +409,7 @@ class _DepositPreviewState extends State { textDecoration: TextDecoration.underline, ), ), - Gap(30), + const Gap(30), ], ), ); diff --git a/lib/features/MainScreens/Wallet/presentation/pages/filterScreen.dart b/lib/features/MainScreens/Wallet/presentation/pages/filterScreen.dart new file mode 100644 index 0000000..90a750d --- /dev/null +++ b/lib/features/MainScreens/Wallet/presentation/pages/filterScreen.dart @@ -0,0 +1,276 @@ +import 'dart:ui'; + +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.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/styles/app_color.dart'; +import 'package:tanami_app/core/styles/app_text.dart'; +import 'package:tanami_app/shared/components/text_widget.dart'; + +class FilterScreen extends StatefulWidget { + const FilterScreen({super.key}); + + @override + State createState() => _FilterScreenState(); +} + +class _FilterScreenState extends State { + List actions = [ + AppText.deposit, + AppText.withdrawal, + AppText.yield, + AppText.refund, + AppText.investment, + ]; + List selected = [ + false, + false, + false, + false, + false, + ]; + int dateIndex = 0; + int statusIndex = 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.filterTitle, + style: GoogleFonts.dmSans( + color: const Color(0xFF272727), + fontSize: 20.sp, + fontWeight: FontWeight.w700, + ), + ), + ), + body: Padding( + padding: const EdgeInsets.all(18.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + AppText.byDate, + style: GoogleFonts.dmSans( + color: const Color(0xFF8D8D8D), + fontSize: 12.sp, + fontWeight: FontWeight.w700, + ), + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Radio( + activeColor: AppColor.radioActiveColor, + value: 1, + groupValue: dateIndex, + onChanged: (int? value) { + setState(() { + dateIndex = value!; + }); + }, + ), + const Gap(3), + Text( + AppText.date1, + style: GoogleFonts.dmSans( + color: const Color(0xFF272727), + fontSize: 14.sp, + fontWeight: FontWeight.w500, + ), + ), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Radio( + activeColor: AppColor.radioActiveColor, + value: 2, + groupValue: dateIndex, + onChanged: (value) { + setState(() { + dateIndex = value!; + }); + }, + ), + const Gap(3), + Text( + AppText.date2, + style: GoogleFonts.dmSans( + color: const Color(0xFF272727), + fontSize: 14.sp, + fontWeight: FontWeight.w500, + ), + ), + ], + ), + const Gap(10), + Text( + AppText.byAction, + style: GoogleFonts.dmSans( + color: const Color(0xFF8D8D8D), + fontSize: 12.sp, + fontWeight: FontWeight.w700, + ), + ), + const Gap(15), + Wrap( + children: List.generate( + actions.length, + (int index) { + return Padding( + padding: const EdgeInsets.only(right: 12.0, bottom: 12.0), + child: GestureDetector( + onTap: () { + setState(() { + for (var i = 0; i < selected.length; i++) { + selected[i] = false; + } + selected[index] = true; + }); + }, + child: Container( + height: 36.h, + padding: const EdgeInsets.symmetric( + vertical: 8, horizontal: 16), + decoration: BoxDecoration( + color: (selected[index] == true) + ? const Color(0xFFe6eff5) + : Colors.white, + borderRadius: BorderRadius.circular(16.r), + border: Border.all( + color: (selected[index] == true) + ? const Color(0xFFe6eff5) + : Colors.grey), + ), + child: Text( + actions[index], + style: GoogleFonts.dmSans( + color: (selected[index] == true) + ? Color(0xFF0167B7) + : const Color(0xFF272727), + fontSize: 14.sp, + fontWeight: FontWeight.w700, + ), + ), + ), + ), + ); + }, + ), + ), + const Gap(10), + Text( + AppText.byStatus, + style: GoogleFonts.dmSans( + color: const Color(0xFF8D8D8D), + fontSize: 12.sp, + fontWeight: FontWeight.w700, + ), + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Radio( + activeColor: AppColor.radioActiveColor, + value: 1, + groupValue: statusIndex, + onChanged: (int? value) { + setState(() { + statusIndex = value!; + }); + }, + ), + const Gap(3), + Text( + AppText.all, + style: GoogleFonts.dmSans( + color: const Color(0xFF272727), + fontSize: 14.sp, + fontWeight: FontWeight.w500, + ), + ), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Radio( + activeColor: AppColor.radioActiveColor, + value: 2, + groupValue: statusIndex, + onChanged: (value) { + setState(() { + statusIndex = value!; + }); + }, + ), + const Gap(3), + Text( + AppText.onHold, + style: GoogleFonts.dmSans( + color: const Color(0xFF272727), + fontSize: 14.sp, + fontWeight: FontWeight.w500, + ), + ), + ], + ), + const Gap(10), + GestureDetector( + onTap: () { + setState(() { + dateIndex = 0; + statusIndex = 0; + for (var i = 0; i < selected.length; i++) { + selected[i] = false; + } + }); + }, + child: TextWidget().text14W700( + AppText.clear, + clr: const Color(0xFF363636), + textDecoration: TextDecoration.underline, + ), + ), + ], + ), + ), + bottomNavigationBar: GestureDetector( + onTap: () { + Navigator.pop(context); + }, + child: Container( + margin: const EdgeInsets.all(12.0), + height: 56.h, + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(22.r), + color: const Color(0xFF004717), + ), + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 20.0), + child: Center( + child: Text( + AppText.Submit, + style: GoogleFonts.dmSans( + color: Colors.white, + fontSize: 14.sp, + fontWeight: FontWeight.w700, + ), + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/features/MainScreens/Wallet/presentation/pages/walletScreen.dart b/lib/features/MainScreens/Wallet/presentation/pages/walletScreen.dart index 3578e94..755c462 100644 --- a/lib/features/MainScreens/Wallet/presentation/pages/walletScreen.dart +++ b/lib/features/MainScreens/Wallet/presentation/pages/walletScreen.dart @@ -16,7 +16,7 @@ class WalletScreen extends StatefulWidget { class _WalletScreenState extends State { List data = [ { - 'title': 'Deposit', + 'title': AppText.deposit, 'subTitle': '', 'dateTime': '10/04/2024 22:04', 'value': '+ SAR 100,000', @@ -24,7 +24,7 @@ class _WalletScreenState extends State { 'onHold': false, }, { - 'title': 'Withdrawal', + 'title': AppText.withdrawal, 'subTitle': '', 'dateTime': '10/04/2024 22:04', 'value': '- SAR 100,000', @@ -32,7 +32,7 @@ class _WalletScreenState extends State { 'onHold': true, }, { - 'title': 'Investment', + 'title': AppText.investment, 'subTitle': 'Name of Investment', 'dateTime': '10/04/2024 22:04', 'value': '- SAR 100,000', @@ -40,7 +40,7 @@ class _WalletScreenState extends State { 'onHold': false, }, { - 'title': 'Yield', + 'title': AppText.yield, 'subTitle': 'Name of Investment', 'dateTime': '10/04/2024 22:04', 'value': '+ SAR 100,000', @@ -48,7 +48,7 @@ class _WalletScreenState extends State { 'onHold': false, }, { - 'title': 'Refund', + 'title': AppText.refund, 'subTitle': '', 'dateTime': '10/04/2024 22:04', 'value': '- SAR 100,000', @@ -240,16 +240,21 @@ class _WalletScreenState extends State { SizedBox( width: 5.w, ), - Container( - decoration: const BoxDecoration( - color: Color(0xFFF6F6F6), - borderRadius: BorderRadius.all(Radius.circular(12.0)), - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Image.asset( - 'assets/images/wallet_screen/filter.png', - height: 20.h, + GestureDetector( + onTap: () { + goRouter.pushNamed(RouteName.filterScreen); + }, + child: Container( + decoration: const BoxDecoration( + color: Color(0xFFF6F6F6), + borderRadius: BorderRadius.all(Radius.circular(12.0)), + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Image.asset( + 'assets/images/wallet_screen/filter.png', + height: 20.h, + ), ), ), ),