register with mobile api body change
This commit is contained in:
4
assets/images/wallet_screen/d_step_1.svg
Normal file
4
assets/images/wallet_screen/d_step_1.svg
Normal file
@@ -0,0 +1,4 @@
|
||||
<svg width="41" height="40" viewBox="0 0 41 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect x="0.5" width="40" height="40" rx="20" fill="#DBF1E4"/>
|
||||
<path d="M19.88 26.5V15.42L17.58 15.96V14L20.96 12.5H22.54V26.5H19.88Z" fill="black"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 252 B |
4
assets/images/wallet_screen/d_step_2.svg
Normal file
4
assets/images/wallet_screen/d_step_2.svg
Normal file
@@ -0,0 +1,4 @@
|
||||
<svg width="41" height="40" viewBox="0 0 41 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect x="0.5" width="40" height="40" rx="20" fill="#DBF1E4"/>
|
||||
<path d="M15.52 26.5V24.64C16.3733 23.9333 17.2 23.2333 18 22.54C18.8133 21.8467 19.5333 21.16 20.16 20.48C20.8 19.8 21.3067 19.14 21.68 18.5C22.0667 17.8467 22.26 17.2133 22.26 16.6C22.26 16.0267 22.1 15.52 21.78 15.08C21.4733 14.64 20.96 14.42 20.24 14.42C19.5067 14.42 18.9533 14.66 18.58 15.14C18.2067 15.62 18.02 16.2 18.02 16.88H15.54C15.5667 15.8533 15.7933 15 16.22 14.32C16.6467 13.6267 17.2133 13.1133 17.92 12.78C18.6267 12.4333 19.42 12.26 20.3 12.26C21.7267 12.26 22.8333 12.6533 23.62 13.44C24.42 14.2133 24.82 15.22 24.82 16.46C24.82 17.2333 24.64 17.9867 24.28 18.72C23.9333 19.4533 23.4733 20.16 22.9 20.84C22.3267 21.52 21.7067 22.16 21.04 22.76C20.3733 23.3467 19.7267 23.8933 19.1 24.4H25.16V26.5H15.52Z" fill="black"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 905 B |
4
assets/images/wallet_screen/d_step_3.svg
Normal file
4
assets/images/wallet_screen/d_step_3.svg
Normal file
@@ -0,0 +1,4 @@
|
||||
<svg width="41" height="40" viewBox="0 0 41 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect x="0.5" width="40" height="40" rx="20" fill="#DBF1E4"/>
|
||||
<path d="M20.44 26.74C19.52 26.74 18.6867 26.58 17.94 26.26C17.1933 25.9267 16.5933 25.42 16.14 24.74C15.6867 24.06 15.4467 23.2067 15.42 22.18H17.94C17.9533 22.86 18.1733 23.4333 18.6 23.9C19.04 24.3533 19.6533 24.58 20.44 24.58C21.1867 24.58 21.76 24.3733 22.16 23.96C22.56 23.5467 22.76 23.0267 22.76 22.4C22.76 21.6667 22.4933 21.1133 21.96 20.74C21.44 20.3533 20.7667 20.16 19.94 20.16H18.9V18.06H19.96C20.64 18.06 21.2067 17.9 21.66 17.58C22.1133 17.26 22.34 16.7867 22.34 16.16C22.34 15.64 22.1667 15.2267 21.82 14.92C21.4867 14.6 21.02 14.44 20.42 14.44C19.7667 14.44 19.2533 14.6333 18.88 15.02C18.52 15.4067 18.32 15.88 18.28 16.44H15.78C15.8333 15.1467 16.28 14.1267 17.12 13.38C17.9733 12.6333 19.0733 12.26 20.42 12.26C21.38 12.26 22.1867 12.4333 22.84 12.78C23.5067 13.1133 24.0067 13.56 24.34 14.12C24.6867 14.68 24.86 15.3 24.86 15.98C24.86 16.7667 24.64 17.4333 24.2 17.98C23.7733 18.5133 23.24 18.8733 22.6 19.06C23.3867 19.22 24.0267 19.6067 24.52 20.22C25.0133 20.82 25.26 21.58 25.26 22.5C25.26 23.2733 25.0733 23.98 24.7 24.62C24.3267 25.26 23.78 25.7733 23.06 26.16C22.3533 26.5467 21.48 26.74 20.44 26.74Z" fill="black"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
@@ -1,13 +1,13 @@
|
||||
<svg width="393" height="852" viewBox="0 0 393 852" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<mask id="mask0_870_81037" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="-84" y="-145" width="539" height="1083">
|
||||
<rect x="-83.6155" y="928.732" width="1073.61" height="520.354" transform="rotate(-89.0361 -83.6155 928.732)" fill="#D9D9D9"/>
|
||||
<mask id="mask0_491_19657" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="-84" y="-145" width="539" height="1083">
|
||||
<rect x="-83.6152" y="928.732" width="1073.61" height="520.354" transform="rotate(-89.0361 -83.6152 928.732)" fill="#D9D9D9"/>
|
||||
</mask>
|
||||
<g mask="url(#mask0_870_81037)">
|
||||
<path d="M-235.912 890.946L-204.615 -68.0479L539.36 -43.7681C551.504 -43.3718 561.027 -33.206 560.63 -21.0622L530.769 893.955C530.372 906.099 520.207 915.622 508.063 915.226L-235.912 890.946Z" fill="#004717"/>
|
||||
<g mask="url(#mask0_491_19657)">
|
||||
<path d="M-235.912 890.946L-204.615 -68.0479L539.359 -43.7681C551.503 -43.3718 561.026 -33.206 560.63 -21.0622L530.768 893.955C530.372 906.099 520.206 915.622 508.062 915.226L-235.912 890.946Z" fill="#002F0F"/>
|
||||
<g opacity="0.03">
|
||||
<path d="M-27.2757 244.241C-21.9062 320.358 24.1712 450.218 69.6501 530.909C77.9484 545.66 92.0023 556.298 108.357 560.371L117.357 562.677C121.191 563.587 125.123 564.316 129.123 564.499C222.626 568.246 386.666 514.463 457.957 477.626C464.907 474.043 471.141 469.257 476.386 463.353L478.984 460.446C490.979 447.12 497.122 429.461 495.842 411.631C488.938 317.313 446.194 196.018 402.489 118.153C394.151 103.264 380.097 92.6263 363.566 88.458L358.577 87.1566C352.072 85.5009 345.431 84.9374 338.655 85.4663C224.698 94.8961 83.3372 140.438 7.1016 181.36C1.48167 184.38 -3.72658 188.323 -8.32792 192.827C-21.819 206.392 -28.6841 225.175 -27.3637 244.193" fill="#FBFBF6"/>
|
||||
<path d="M-167.004 355.133C-161.634 431.25 -115.557 561.111 -70.078 641.802C-61.7797 656.552 -47.6769 667.1 -31.3706 671.263L-22.3713 673.57C-18.5369 674.479 -14.6049 675.209 -10.605 675.392C82.8981 679.139 246.938 625.355 318.229 588.518C325.179 584.935 331.413 580.149 336.658 574.245L339.256 571.338C351.251 558.013 357.394 540.353 356.114 522.524C349.21 428.206 306.466 306.911 262.761 229.045C254.423 214.157 240.369 203.519 223.838 199.351L218.849 198.049C212.344 196.393 205.703 195.83 198.927 196.359C84.9696 205.789 -56.3909 251.33 -132.626 292.253C-138.246 295.273 -143.455 299.215 -148.056 303.719C-161.547 317.284 -168.412 336.068 -167.092 355.085" fill="black"/>
|
||||
<path d="M462.972 612.8C470.146 599.547 473.573 584.381 472.452 569.202C465.07 466.932 418.089 342.527 377.528 270.211C367.515 252.317 350.28 239.141 330.453 234.121L325.464 232.82C317.355 230.762 309.276 230.12 301.278 230.803C181.942 240.703 38.5989 288.435 -35.6527 328.217C-42.514 331.847 -48.8362 336.586 -54.3362 342.119C-70.6016 358.496 -78.9785 381.124 -77.3801 404.256C-71.5733 487.138 -21.6391 620.602 21.2433 696.623C31.217 714.378 48.3246 727.369 68.1523 732.389L77.1516 734.695C82.1891 735.906 86.884 736.699 91.5586 736.898C186.138 740.761 350.765 687.995 427.031 648.488C435.408 644.162 442.99 638.357 449.369 631.201L451.967 628.294C456.265 623.509 459.995 618.3 463.021 612.71M-44.4269 373.246C-42.0844 368.919 -39.1254 364.924 -35.5988 361.354C-32.0234 357.694 -27.8899 354.685 -23.5113 352.275C48.3945 313.672 187.212 267.57 302.841 257.996C307.946 257.611 313.197 258.006 318.411 259.313L323.4 260.614C336.322 263.878 347.537 272.397 354.072 284.094C393.252 353.914 438.536 473.67 445.689 571.736C446.681 585.68 441.816 599.717 432.37 610.226L429.772 613.133C425.572 617.737 420.686 621.504 415.252 624.392C343.315 661.58 182.061 713.373 93.1441 709.777C90.3569 709.668 87.3151 709.187 84.1066 708.383L75.1073 706.076C62.1856 702.813 51.1459 694.389 44.6015 682.919C-2.88587 598.577 -45.5659 472.537 -50.5777 401.859C-51.2824 391.802 -49.1119 381.902 -44.4269 373.246Z" fill="#747474"/>
|
||||
<path d="M-27.2757 244.241C-21.9062 320.358 24.1712 450.218 69.6501 530.909C77.9484 545.66 92.0024 556.298 108.357 560.371L117.357 562.677C121.191 563.587 125.123 564.316 129.123 564.499C222.626 568.246 386.666 514.463 457.957 477.626C464.907 474.043 471.141 469.257 476.386 463.353L478.984 460.446C490.979 447.12 497.122 429.461 495.842 411.631C488.938 317.313 446.194 196.018 402.489 118.153C394.151 103.264 380.097 92.6263 363.566 88.458L358.577 87.1566C352.072 85.5009 345.431 84.9374 338.655 85.4663C224.698 94.8961 83.3372 140.438 7.10159 181.36C1.48167 184.38 -3.72657 188.323 -8.32793 192.827C-21.819 206.392 -28.6841 225.175 -27.3637 244.193" fill="#FBFBF6"/>
|
||||
<path d="M-167.003 355.133C-161.634 431.25 -115.556 561.111 -70.0775 641.802C-61.7792 656.552 -47.6764 667.1 -31.3701 671.263L-22.3708 673.57C-18.5364 674.479 -14.6044 675.209 -10.6045 675.392C82.8986 679.139 246.938 625.355 318.23 588.518C325.179 584.935 331.413 580.149 336.659 574.245L339.257 571.338C351.252 558.013 357.395 540.353 356.115 522.524C349.21 428.206 306.467 306.911 262.761 229.045C254.423 214.157 240.369 203.519 223.838 199.351L218.849 198.049C212.345 196.393 205.704 195.83 198.927 196.359C84.9701 205.789 -56.3904 251.33 -132.626 292.253C-138.246 295.273 -143.454 299.215 -148.055 303.719C-161.547 317.284 -168.412 336.068 -167.091 355.085" fill="black"/>
|
||||
<path d="M462.972 612.8C470.146 599.547 473.573 584.381 472.452 569.202C465.07 466.932 418.089 342.527 377.528 270.211C367.515 252.317 350.281 239.141 330.453 234.121L325.464 232.82C317.355 230.762 309.277 230.12 301.278 230.803C181.942 240.703 38.5991 288.435 -35.6525 328.217C-42.5137 331.847 -48.836 336.586 -54.3359 342.119C-70.6014 358.496 -78.9783 381.124 -77.3798 404.256C-71.5731 487.138 -21.6389 620.602 21.2436 696.623C31.2172 714.378 48.3248 727.369 68.1525 732.389L77.1518 734.695C82.1894 735.906 86.8842 736.699 91.5589 736.898C186.138 740.761 350.765 687.995 427.032 648.488C435.408 644.162 442.991 638.357 449.369 631.201L451.967 628.294C456.265 623.509 459.995 618.3 463.021 612.71M-44.4266 373.246C-42.0841 368.919 -39.1251 364.924 -35.5985 361.354C-32.0231 357.694 -27.8897 354.685 -23.5111 352.275C48.3947 313.672 187.212 267.57 302.841 257.996C307.946 257.611 313.198 258.006 318.411 259.313L323.4 260.614C336.322 263.878 347.538 272.397 354.073 284.094C393.252 353.914 438.537 473.67 445.689 571.736C446.682 585.68 441.816 599.717 432.371 610.226L429.772 613.133C425.572 617.737 420.686 621.504 415.252 624.392C343.316 661.58 182.061 713.373 93.1443 709.777C90.3571 709.668 87.3153 709.187 84.1069 708.383L75.1076 706.076C62.1858 702.813 51.1462 694.389 44.6017 682.919C-2.88562 598.577 -45.5657 472.537 -50.5774 401.859C-51.2822 391.802 -49.1117 381.902 -44.4266 373.246Z" fill="#747474"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
@@ -43,6 +43,8 @@ class RouteName {
|
||||
static const String withdrawalConfirmation = 'withdrawalConfirmation';
|
||||
static const String depositScreen = 'depositScreen';
|
||||
static const String depositPreview = 'depositPreview';
|
||||
static const String selectDepositMethodScreen = 'selectDepositMethodScreen';
|
||||
static const String depositStepScreen = 'depositStepScreen';
|
||||
|
||||
//Biometric
|
||||
static const String biometricScreen = 'biometricScreen';
|
||||
|
||||
@@ -8,12 +8,14 @@ import 'package:tanami_app/features/MainScreens/Invest/presentation/pages/paymen
|
||||
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/deposit_screen.dart';
|
||||
import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/deposit/deposit_step_screen.dart';
|
||||
import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/deposit/preview.dart';
|
||||
import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/deposit/select_deposit_method_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/wallet_details.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';
|
||||
import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/withdrawal/withdrawalScreen.dart';
|
||||
import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/withdrawal/withdrawal_screen.dart';
|
||||
import 'package:tanami_app/features/biometric/presentation/pages/biometric_screen.dart';
|
||||
import 'package:tanami_app/features/changePassword/presentation/pages/change_password_screen.dart';
|
||||
import 'package:tanami_app/features/contactAdmin/presentation/pages/contact_admin_screen.dart';
|
||||
@@ -208,6 +210,20 @@ final goRouter = GoRouter(
|
||||
return const DepositScreen();
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
name: RouteName.selectDepositMethodScreen,
|
||||
path: RouteName.selectDepositMethodScreen,
|
||||
builder: (context, state) {
|
||||
return const SelectDepositMethodScreen();
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
name: RouteName.depositStepScreen,
|
||||
path: RouteName.depositStepScreen,
|
||||
builder: (context, state) {
|
||||
return const DepositStepScreen();
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
name: RouteName.depositPreview,
|
||||
path: RouteName.depositPreview,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class AppImages {
|
||||
//Splash
|
||||
static const String splashBg =
|
||||
"assets/images/welcome_screen/svg/tanamibg.svg";
|
||||
"assets/images/welcome_screen/svg/Splash_BG.svg";
|
||||
static const String splashLogo =
|
||||
"assets/images/welcome_screen/svg/Tanami_Capital_Splash_Logo.svg";
|
||||
|
||||
@@ -129,7 +129,6 @@ class AppImages {
|
||||
'assets/images/wallet_screen/search.png';
|
||||
static const String walletFilterIcon =
|
||||
'assets/images/wallet_screen/filter.png';
|
||||
|
||||
static const String depositListIcon =
|
||||
'assets/images/wallet_screen/deposit_list.png';
|
||||
static const String withdrawalListIcon =
|
||||
@@ -140,4 +139,7 @@ class AppImages {
|
||||
'assets/images/wallet_screen/yield_list.png';
|
||||
static const String refundListIcon =
|
||||
'assets/images/wallet_screen/refund_list.png';
|
||||
static const String dStep1Icon = 'assets/images/wallet_screen/d_step_1.svg';
|
||||
static const String dStep2Icon = 'assets/images/wallet_screen/d_step_2.svg';
|
||||
static const String dStep3Icon = 'assets/images/wallet_screen/d_step_3.svg';
|
||||
}
|
||||
|
||||
@@ -14,12 +14,12 @@ import '../../../../../../core/styles/app_images.dart';
|
||||
import '../../../../../../core/styles/app_text.dart';
|
||||
import '../../../../../../core/utils/language/localizations_delegate.dart';
|
||||
import '../../../../../../core/utils/text_formatter/comma_input_text_formatter.dart';
|
||||
import '../../../../../../shared/components/text_widget.dart';
|
||||
import '../../../../../countrySelection/bloc/choose_country_bloc.dart';
|
||||
import '../../../../../countrySelection/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';
|
||||
import '../../widgets/deposit_pay_method_section.dart';
|
||||
|
||||
class DepositLayout extends StatelessWidget {
|
||||
const DepositLayout({super.key});
|
||||
@@ -28,13 +28,12 @@ class DepositLayout extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
var localizations = AppLocalizations.of(context);
|
||||
final depositPaymentBloc = context.read<DepositPaymentBloc>();
|
||||
|
||||
int selectedIndex = 0;
|
||||
return Scaffold(
|
||||
bottomNavigationBar: BlocBuilder<DepositPaymentBloc, DepositPaymentState>(
|
||||
builder: (context, state) {
|
||||
return BlocBuilder<RadioBloc, RadioState>(
|
||||
builder: (context, radioState) {
|
||||
int selectedIndex = 0;
|
||||
if (radioState is RadioSelectionChanged) {
|
||||
selectedIndex = radioState.selectedIndex;
|
||||
}
|
||||
@@ -93,7 +92,7 @@ class DepositLayout extends StatelessWidget {
|
||||
: AppColor.inactiveBtnColor),
|
||||
child: Center(
|
||||
child: Text(
|
||||
localizations.translate(AppText.depositNoti),
|
||||
localizations.translate(AppText.next),
|
||||
style: GoogleFonts.dmSans(
|
||||
color: state.isFormValid
|
||||
? AppColor.plainWhite
|
||||
@@ -117,258 +116,222 @@ class DepositLayout extends StatelessWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
RichText(
|
||||
text: TextSpan(
|
||||
children: [
|
||||
TextSpan(
|
||||
text: '${localizations.translate(AppText.balance)}: ',
|
||||
style: GoogleFonts.dmSans(
|
||||
color: Colors.grey,
|
||||
fontSize: 12.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: 'SAR 178,000',
|
||||
style: GoogleFonts.dmSans(
|
||||
color: Colors.black,
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
// RichText(
|
||||
// text: TextSpan(
|
||||
// children: [
|
||||
// TextSpan(
|
||||
// text: '${localizations.translate(AppText.balance)}: ',
|
||||
// style: GoogleFonts.dmSans(
|
||||
// color: Colors.grey,
|
||||
// fontSize: 12.sp,
|
||||
// fontWeight: FontWeight.bold,
|
||||
// ),
|
||||
// ),
|
||||
// TextSpan(
|
||||
// text: 'SAR 178,000',
|
||||
// style: GoogleFonts.dmSans(
|
||||
// color: Colors.black,
|
||||
// fontSize: 14.sp,
|
||||
// fontWeight: FontWeight.bold,
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
|
||||
// SizedBox(
|
||||
// height: 20.h,
|
||||
// ),
|
||||
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,
|
||||
),
|
||||
),
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: selectedIndex == 1
|
||||
? Row(children: [
|
||||
SvgPicture.asset(AppImages.applePayIcon),
|
||||
const Gap(5),
|
||||
TextWidget().text14W700(
|
||||
localizations
|
||||
.translate(AppText.applePayText),
|
||||
clr: AppColor.textLabelColor),
|
||||
])
|
||||
: Row(
|
||||
children: [
|
||||
SvgPicture.asset(AppImages.walletIcon),
|
||||
const Gap(5),
|
||||
TextWidget().text14W700(
|
||||
localizations
|
||||
.translate(AppText.bankTransfer),
|
||||
clr: AppColor.textLabelColor),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
width: 12.w,
|
||||
),
|
||||
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.w400,
|
||||
),
|
||||
Text(
|
||||
localizations.translate(AppText.depositTitle),
|
||||
),
|
||||
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 localizations.translate(
|
||||
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: 17.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
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),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
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: 280.w,
|
||||
child: TextFormField(
|
||||
inputFormatters: [
|
||||
CommaTextInputFormatter(),
|
||||
FilteringTextInputFormatter.deny(
|
||||
RegExp(r'\s')),
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
],
|
||||
validator: (value) {
|
||||
if (depositPaymentBloc
|
||||
.amountController.text.isEmpty) {
|
||||
return localizations.translate(
|
||||
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),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
// 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,
|
||||
// children: [
|
||||
// Text(
|
||||
// localizations
|
||||
// .translate(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,
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
|
||||
const Gap(15),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
localizations
|
||||
.translate("Total : SAR ${state.amount}"),
|
||||
style: GoogleFonts.dmSans(
|
||||
color: const Color(0xFF066123),
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
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,
|
||||
children: [
|
||||
Text(
|
||||
localizations
|
||||
.translate(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,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
localizations
|
||||
.translate(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(),
|
||||
const Gap(16),
|
||||
// const Gap(30),
|
||||
// const DepositPayMethodSection(),
|
||||
// const Gap(16),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -8,15 +8,9 @@ import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/deposi
|
||||
|
||||
import '../../../../../../core/utils/language/localizations_delegate.dart';
|
||||
|
||||
class DepositScreen extends StatefulWidget {
|
||||
class DepositScreen extends StatelessWidget {
|
||||
const DepositScreen({super.key});
|
||||
|
||||
@override
|
||||
State<DepositScreen> createState() => _DepositScreenState();
|
||||
}
|
||||
|
||||
class _DepositScreenState extends State<DepositScreen> {
|
||||
int selectedIndex = 0;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var localizations = AppLocalizations.of(context);
|
||||
@@ -28,7 +22,7 @@ class _DepositScreenState extends State<DepositScreen> {
|
||||
scrolledUnderElevation: 0.0,
|
||||
centerTitle: true,
|
||||
title: Text(
|
||||
localizations.translate(AppText.depositScreenTitle),
|
||||
localizations.translate(AppText.deposit),
|
||||
style: GoogleFonts.dmSans(
|
||||
color: const Color(0xFF272727),
|
||||
fontSize: 20.sp,
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
import 'package:flutter/material.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 'package:tanami_app/core/routes/routes.dart';
|
||||
import 'package:tanami_app/core/styles/app_images.dart';
|
||||
import 'package:tanami_app/shared/components/text_widget.dart';
|
||||
|
||||
import '../../../../../../core/styles/app_color.dart';
|
||||
import '../../../../../../core/styles/app_text.dart';
|
||||
import '../../../../../../core/utils/language/localizations_delegate.dart';
|
||||
import '../../../../../../shared/components/button_widget.dart';
|
||||
|
||||
class DepositStepScreen extends StatelessWidget {
|
||||
const DepositStepScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var localizations = AppLocalizations.of(context);
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
bottomNavigationBar: Container(
|
||||
margin: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 16,
|
||||
),
|
||||
width: 1.sw,
|
||||
height: 56.h,
|
||||
child: ButtonWidget().elevatedBtn(
|
||||
txtClr: AppColor.plainWhite,
|
||||
function: () {
|
||||
goRouter.pushNamed(RouteName.depositScreen);
|
||||
},
|
||||
text: localizations.translate(AppText.next),
|
||||
clr: AppColor.primaryColor2,
|
||||
),
|
||||
),
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.white,
|
||||
elevation: 0,
|
||||
scrolledUnderElevation: 0.0,
|
||||
centerTitle: true,
|
||||
title: Text(
|
||||
localizations.translate(AppText.bankTransfer),
|
||||
style: GoogleFonts.dmSans(
|
||||
color: const Color(0xFF272727),
|
||||
fontSize: 20.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
actions: const [
|
||||
Icon(
|
||||
Icons.info,
|
||||
color: Color(0xFF363636),
|
||||
),
|
||||
Gap(10)
|
||||
],
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 20),
|
||||
decoration: ShapeDecoration(
|
||||
color: const Color(0xFFF6F6F6),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(22),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 0.8.sw,
|
||||
child: Text(
|
||||
'In order for you to complete a bank transfer, you need will need to create a deposit notification and transfer funds from your wallet, directly into your bank account.',
|
||||
style: GoogleFonts.dmSans(
|
||||
color: const Color(0xFF363636),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
const Icon(
|
||||
Icons.close,
|
||||
color: Color(0xFF363636),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
const Gap(16),
|
||||
TextWidget().text15W700("Please complete the below steps",
|
||||
clr: AppColor.plainBlack),
|
||||
const Gap(16),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: ListView(
|
||||
shrinkWrap: true,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
SvgPicture.asset(AppImages.dStep1Icon),
|
||||
const Gap(16),
|
||||
Expanded(
|
||||
child: TextWidget().text14W400(
|
||||
"Insert the amount you would like to transfer.",
|
||||
clr: const Color(0xFF363636),
|
||||
txtAlign: TextAlign.start,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
const Gap(24),
|
||||
Row(
|
||||
children: [
|
||||
SvgPicture.asset(AppImages.dStep2Icon),
|
||||
const Gap(16),
|
||||
Expanded(
|
||||
child: TextWidget().text14W400(
|
||||
"Copy the bank details of your Tanami account shown on the next page. Make sure to keep note of the reference ID.",
|
||||
clr: const Color(0xFF363636),
|
||||
txtAlign: TextAlign.start,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
const Gap(24),
|
||||
Row(
|
||||
children: [
|
||||
SvgPicture.asset(AppImages.dStep3Icon),
|
||||
const Gap(16),
|
||||
Expanded(
|
||||
child: TextWidget().text14W400(
|
||||
"Insert the amount you would like to transfer.",
|
||||
clr: const Color(0xFF363636),
|
||||
txtAlign: TextAlign.start,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
TextWidget().text13W500(
|
||||
"Tanami will notify you upon receipt of your funds and it will appear in your wallet balance 3-4 business days after initiating the transfer.",
|
||||
clr: const Color(0xFF888888),
|
||||
fontStyle: FontStyle.italic),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@ 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/routes.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';
|
||||
|
||||
import '../../../../../../core/utils/language/localizations_delegate.dart';
|
||||
|
||||
@@ -17,13 +17,13 @@ class DepositPreview extends StatefulWidget {
|
||||
|
||||
class _DepositPreviewState extends State<DepositPreview> {
|
||||
List values = [
|
||||
'Name Surname',
|
||||
'DE 1234 5678 9012 3456',
|
||||
'Hohenzollernring 58, 95444',
|
||||
'Name Bank',
|
||||
'Hohenzollernring 58, 95444',
|
||||
'BC12345',
|
||||
'FRYU FHDU 1234',
|
||||
'Tanami Capital W.L.L',
|
||||
'100000480779',
|
||||
'BH 23 BBKU 00100 00048 0779',
|
||||
'BBKUBHBM',
|
||||
'Bank of Bahrain and Kuwait B.S.C',
|
||||
'43 Government Avenue, Manama, Kingdom of Bahrain',
|
||||
'BH00600000',
|
||||
];
|
||||
|
||||
List titles2 = [
|
||||
@@ -42,13 +42,13 @@ class _DepositPreviewState extends State<DepositPreview> {
|
||||
Widget build(BuildContext context) {
|
||||
var localizations = AppLocalizations.of(context);
|
||||
List titles = [
|
||||
localizations.translate(AppText.accountHolderName),
|
||||
localizations.translate(AppText.iban),
|
||||
localizations.translate(AppText.beneficiaryAddress),
|
||||
localizations.translate(AppText.bankName),
|
||||
localizations.translate(AppText.branchAddress),
|
||||
localizations.translate(AppText.SWIFTcode),
|
||||
localizations.translate(AppText.refid),
|
||||
localizations.translate("Account Name"),
|
||||
localizations.translate("Account No."),
|
||||
localizations.translate("IBAN"),
|
||||
localizations.translate("SWIFT Code"),
|
||||
localizations.translate("Bank Name"),
|
||||
localizations.translate("Bank Address"),
|
||||
localizations.translate("Client ID"),
|
||||
];
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
@@ -58,7 +58,7 @@ class _DepositPreviewState extends State<DepositPreview> {
|
||||
scrolledUnderElevation: 0.0,
|
||||
centerTitle: true,
|
||||
title: Text(
|
||||
localizations.translate(AppText.depositScreenTitle),
|
||||
localizations.translate("Deposit confirmation"),
|
||||
style: GoogleFonts.dmSans(
|
||||
color: const Color(0xFF272727),
|
||||
fontSize: 20.sp,
|
||||
@@ -281,90 +281,102 @@ class _DepositPreviewState extends State<DepositPreview> {
|
||||
// SizedBox(
|
||||
// height: 20.h,
|
||||
// ),
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
localizations.translate(AppText.depositDetails),
|
||||
style: GoogleFonts.dmSans(
|
||||
color: Colors.black,
|
||||
fontSize: 15.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
const Divider(
|
||||
color: Color(0xFFE3E3E3),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
ListView.builder(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemCount: titles.length,
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (context, index) {
|
||||
return Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
Card(
|
||||
color: AppColor.plainWhite,
|
||||
elevation: 5,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
localizations.translate(AppText.depositDetails),
|
||||
style: GoogleFonts.dmSans(
|
||||
color: Colors.black,
|
||||
fontSize: 15.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
const Divider(
|
||||
color: Color(0xFFE3E3E3),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
ListView.builder(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemCount: titles.length,
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (context, index) {
|
||||
return Column(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
titles[index],
|
||||
style: GoogleFonts.dmSans(
|
||||
color: Colors.black,
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 8.h,
|
||||
),
|
||||
Text(
|
||||
values[index],
|
||||
style: GoogleFonts.dmSans(
|
||||
color: const Color(0xFF191B1E),
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
titles[index],
|
||||
style: GoogleFonts.dmSans(
|
||||
color: Colors.black,
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 8.h,
|
||||
),
|
||||
SizedBox(
|
||||
width: 0.8.sw,
|
||||
child: Text(
|
||||
values[index],
|
||||
style: GoogleFonts.dmSans(
|
||||
color: const Color(0xFF191B1E),
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
// Image.asset(
|
||||
// 'assets/images/wallet_screen/copy.png',
|
||||
// height: 25.h,
|
||||
// )
|
||||
],
|
||||
),
|
||||
Image.asset(
|
||||
'assets/images/wallet_screen/copy.png',
|
||||
height: 25.h,
|
||||
)
|
||||
(index != titles.length - 1)
|
||||
? Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 12.h,
|
||||
),
|
||||
Divider(
|
||||
color: const Color(0xFFE3E3E3),
|
||||
height: 2.h),
|
||||
SizedBox(
|
||||
height: 12.h,
|
||||
),
|
||||
],
|
||||
)
|
||||
: SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
],
|
||||
),
|
||||
(index != titles.length - 1)
|
||||
? Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 12.h,
|
||||
),
|
||||
Divider(
|
||||
color: const Color(0xFFE3E3E3),
|
||||
height: 2.h),
|
||||
SizedBox(
|
||||
height: 12.h,
|
||||
),
|
||||
],
|
||||
)
|
||||
: SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
)
|
||||
],
|
||||
);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -378,6 +390,8 @@ class _DepositPreviewState extends State<DepositPreview> {
|
||||
onTap: () {
|
||||
goRouter.pop();
|
||||
goRouter.pop();
|
||||
goRouter.pop();
|
||||
goRouter.pop();
|
||||
},
|
||||
child: Container(
|
||||
margin: const EdgeInsets.all(10.0),
|
||||
@@ -391,7 +405,7 @@ class _DepositPreviewState extends State<DepositPreview> {
|
||||
padding: const EdgeInsets.symmetric(vertical: 20.0),
|
||||
child: Center(
|
||||
child: Text(
|
||||
localizations.translate(AppText.submitDeposit),
|
||||
localizations.translate(AppText.depositNoti),
|
||||
style: GoogleFonts.dmSans(
|
||||
color: Colors.white,
|
||||
fontSize: 14.sp,
|
||||
@@ -403,19 +417,19 @@ class _DepositPreviewState extends State<DepositPreview> {
|
||||
),
|
||||
),
|
||||
const Gap(10),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
goRouter.pop();
|
||||
},
|
||||
child: Center(
|
||||
child: TextWidget().text14W700(
|
||||
localizations.translate(AppText.back),
|
||||
clr: const Color(0xFF363636),
|
||||
textDecoration: TextDecoration.underline,
|
||||
),
|
||||
),
|
||||
),
|
||||
const Gap(20),
|
||||
// GestureDetector(
|
||||
// onTap: () {
|
||||
// goRouter.pop();
|
||||
// },
|
||||
// child: Center(
|
||||
// child: TextWidget().text14W700(
|
||||
// localizations.translate(AppText.back),
|
||||
// clr: const Color(0xFF363636),
|
||||
// textDecoration: TextDecoration.underline,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// const Gap(20),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
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/routes/route_name.dart';
|
||||
import 'package:tanami_app/core/routes/routes.dart';
|
||||
|
||||
import '../../../../../../core/styles/app_color.dart';
|
||||
import '../../../../../../core/styles/app_text.dart';
|
||||
import '../../../../../../core/utils/language/localizations_delegate.dart';
|
||||
import '../../../../../../shared/components/button_widget.dart';
|
||||
import '../../../../../countrySelection/bloc/choose_country_bloc.dart';
|
||||
import '../../widgets/deposit_pay_method_section.dart';
|
||||
|
||||
class SelectDepositMethodScreen extends StatelessWidget {
|
||||
const SelectDepositMethodScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var localizations = AppLocalizations.of(context);
|
||||
final radioBloc = context.read<RadioBloc>();
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
bottomNavigationBar: Container(
|
||||
margin: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 16,
|
||||
),
|
||||
width: 1.sw,
|
||||
height: 56.h,
|
||||
child: ButtonWidget().elevatedBtn(
|
||||
txtClr: AppColor.plainWhite,
|
||||
function: () {
|
||||
if (radioBloc.selectedCountry == 0) {
|
||||
goRouter.pushNamed(RouteName.depositStepScreen);
|
||||
} else {
|
||||
goRouter.pushNamed(RouteName.depositScreen);
|
||||
}
|
||||
},
|
||||
text: localizations.translate(AppText.next),
|
||||
clr: AppColor.primaryColor2,
|
||||
),
|
||||
),
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.white,
|
||||
elevation: 0,
|
||||
scrolledUnderElevation: 0.0,
|
||||
centerTitle: true,
|
||||
title: Text(
|
||||
localizations.translate(AppText.deposit),
|
||||
style: GoogleFonts.dmSans(
|
||||
color: const Color(0xFF272727),
|
||||
fontSize: 20.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
body: const Padding(
|
||||
padding: EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
children: [
|
||||
DepositPayMethodSection(),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -88,7 +88,8 @@ class _WalletScreenState extends State<WalletScreen> {
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
goRouter.pushNamed(RouteName.depositScreen);
|
||||
goRouter.pushNamed(
|
||||
RouteName.selectDepositMethodScreen);
|
||||
},
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
|
||||
abstract class OTPEvent {
|
||||
const OTPEvent();
|
||||
|
||||
List<Object> get props => [];
|
||||
}
|
||||
|
||||
class RequestOTP extends OTPEvent {
|
||||
final Map<String, dynamic> OTPRequestData;
|
||||
RequestOTP(this.OTPRequestData);
|
||||
|
||||
@override
|
||||
List<Object> get props => [OTPRequestData];
|
||||
|
||||
}
|
||||
class VerifyOTP extends OTPEvent {
|
||||
VerifyOTP();
|
||||
|
||||
|
||||
}
|
||||
abstract class OTPState{}
|
||||
class OTPInitial extends OTPState {}
|
||||
|
||||
class OTPLoading extends OTPState {}
|
||||
|
||||
class OTPLoaded extends OTPState {}
|
||||
|
||||
class OTPFailed extends OTPState {
|
||||
final String failedmessage;
|
||||
|
||||
OTPFailed(this.failedmessage);
|
||||
}
|
||||
class OTPError extends OTPState {
|
||||
final String errormessage;
|
||||
|
||||
OTPError(this.errormessage);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import 'package:bloc/bloc.dart';
|
||||
import 'package:tanami_app/features/countrySelection/bloc/GetCountry/get_country_event.dart';
|
||||
|
||||
import '../../../../Api_Helper/base_manager.dart';
|
||||
import '../../domain/model/get_country_model.dart';
|
||||
import '../../domain/repositories/get_country_api.dart';
|
||||
import 'get_country_state.dart';
|
||||
|
||||
class GetCountryBlock extends Bloc<GetCountryEvent, GetCountryState> {
|
||||
GetCountryBlock() : super(CountryInitial()) {
|
||||
on<GetCountry>(mapEventToState);
|
||||
}
|
||||
Future<void> mapEventToState(
|
||||
GetCountry event, Emitter<GetCountryState> emit) async {
|
||||
emit(CountryLoading());
|
||||
try {
|
||||
ResponseData response = await GetCountryAPI().getcountryAPI();
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
GetCountryModel countryModel = GetCountryModel.fromJson(response.data);
|
||||
emit(CountryLoaded(countryModel));
|
||||
}
|
||||
print("//");
|
||||
} catch (e) {
|
||||
emit(CountryError("Oops Something went wrong"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
abstract class GetCountryEvent {
|
||||
const GetCountryEvent();
|
||||
|
||||
get props => [];
|
||||
}
|
||||
|
||||
class GetCountry extends GetCountryEvent {
|
||||
GetCountry();
|
||||
}
|
||||
@@ -1,17 +1,7 @@
|
||||
import '../../domain/model/GetCountry_model.dart';
|
||||
import '../../domain/model/get_country_model.dart';
|
||||
|
||||
abstract class GetCountryEvent {
|
||||
const GetCountryEvent();
|
||||
abstract class GetCountryState {}
|
||||
|
||||
get props => [];
|
||||
}
|
||||
|
||||
class GetCountry extends GetCountryEvent {
|
||||
GetCountry();
|
||||
|
||||
|
||||
}
|
||||
abstract class GetCountryState{}
|
||||
// Define states
|
||||
//enum GetCountryState { initial, loading, success, failure, error }
|
||||
class CountryInitial extends GetCountryState {}
|
||||
@@ -28,4 +18,4 @@ class CountryError extends GetCountryState {
|
||||
final String message;
|
||||
|
||||
CountryError(this.message);
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
import 'package:bloc/bloc.dart';
|
||||
import 'package:tanami_app/features/countrySelection/bloc/GetCountry/getcountryevent_bloc.dart';
|
||||
|
||||
import '../../../../Api_Helper/base_manager.dart';
|
||||
import '../../domain/model/GetCountry_model.dart';
|
||||
import 'GetCountryAPI.dart';
|
||||
|
||||
|
||||
class GetCountryBlock extends Bloc<GetCountryEvent, GetCountryState> {
|
||||
GetCountryBlock() : super(CountryInitial()) {
|
||||
on<GetCountry>(mapEventToState);
|
||||
}
|
||||
Future<void> mapEventToState(
|
||||
GetCountry event, Emitter<GetCountryState> emit) async {
|
||||
if (event is GetCountry) {
|
||||
emit(CountryLoading());
|
||||
try {
|
||||
ResponseData response = await GetCountryAPI().getcountryAPI();
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
GetCountryModel countryModel =
|
||||
GetCountryModel.fromJson(response.data);
|
||||
emit(CountryLoaded(countryModel));
|
||||
}
|
||||
print("//");
|
||||
} catch (e) {
|
||||
emit(CountryError("Oops Something went wrong"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,19 @@
|
||||
class GetCountryModel {
|
||||
List<Data>? data;
|
||||
|
||||
GetCountryModel({ this.data});
|
||||
GetCountryModel({this.data});
|
||||
|
||||
GetCountryModel.fromJson(Map<String, dynamic> json) {
|
||||
if (json['data'] != null) {
|
||||
data = <Data>[];
|
||||
json['data'].forEach((v) {
|
||||
data!.add(new Data.fromJson(v));
|
||||
data!.add(Data.fromJson(v));
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
@@ -28,10 +27,10 @@ class Data {
|
||||
String? countryCode;
|
||||
String? isdCode;
|
||||
String? flagIcon;
|
||||
Null? currencyXid;
|
||||
Null currencyXid;
|
||||
bool? isActive;
|
||||
Null? createdBy;
|
||||
Null? modifiedBy;
|
||||
Null createdBy;
|
||||
Null modifiedBy;
|
||||
|
||||
Data(
|
||||
{this.id,
|
||||
@@ -57,16 +56,16 @@ class Data {
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['countryName'] = this.countryName;
|
||||
data['countryCode'] = this.countryCode;
|
||||
data['isdCode'] = this.isdCode;
|
||||
data['flagIcon'] = this.flagIcon;
|
||||
data['currency_xid'] = this.currencyXid;
|
||||
data['isActive'] = this.isActive;
|
||||
data['createdBy'] = this.createdBy;
|
||||
data['modifiedBy'] = this.modifiedBy;
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['countryName'] = countryName;
|
||||
data['countryCode'] = countryCode;
|
||||
data['isdCode'] = isdCode;
|
||||
data['flagIcon'] = flagIcon;
|
||||
data['currency_xid'] = currencyXid;
|
||||
data['isActive'] = isActive;
|
||||
data['createdBy'] = createdBy;
|
||||
data['modifiedBy'] = modifiedBy;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -4,12 +4,12 @@ import 'package:flutter_bloc/flutter_bloc.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/utils/constant/country_flag_data.dart';
|
||||
import 'package:tanami_app/features/countrySelection/bloc/GetCountry/getcountry_bloc.dart';
|
||||
import 'package:tanami_app/features/countrySelection/bloc/GetCountry/getcountryevent_bloc.dart';
|
||||
import 'package:tanami_app/features/countrySelection/bloc/GetCountry/get_country_bloc.dart';
|
||||
import 'package:tanami_app/features/countrySelection/bloc/GetCountry/get_country_event.dart';
|
||||
import 'package:tanami_app/shared/components/text_widget.dart';
|
||||
|
||||
import '../../../../shared/api/api_endpoints.dart';
|
||||
import '../../bloc/GetCountry/get_country_state.dart';
|
||||
import '../../bloc/choose_country_bloc.dart';
|
||||
import '../../bloc/choose_country_event.dart';
|
||||
import '../../bloc/choose_country_state.dart';
|
||||
@@ -30,11 +30,11 @@ class CountrySelectionList extends StatelessWidget {
|
||||
|
||||
return BlocConsumer<GetCountryBlock, GetCountryState>(
|
||||
listener: (context, state) {
|
||||
if (state == CountryLoaded) {
|
||||
if (state is CountryLoaded) {
|
||||
const SnackBar(content: Text("Successfully fetch"));
|
||||
} else if (state == CountryError) {
|
||||
} else if (state is CountryError) {
|
||||
const SnackBar(content: Text("error while fetching data"));
|
||||
Future.delayed(Duration(milliseconds: 3), () {
|
||||
Future.delayed(const Duration(milliseconds: 3), () {
|
||||
context.read<GetCountryBlock>().add(GetCountry());
|
||||
});
|
||||
} else {
|
||||
@@ -43,7 +43,7 @@ class CountrySelectionList extends StatelessWidget {
|
||||
}, builder: (context, state) {
|
||||
print(state);
|
||||
if (state is CountryLoading) {
|
||||
return Center(child: CircularProgressIndicator());
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
} else if (state is CountryLoaded) {
|
||||
return ListView.builder(
|
||||
itemCount: state.countryModel.data?.length ?? 0,
|
||||
@@ -54,26 +54,28 @@ class CountrySelectionList extends StatelessWidget {
|
||||
title: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
SizedBox(
|
||||
height: 24.h,
|
||||
width: 24.w,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(100)),
|
||||
borderRadius:
|
||||
const BorderRadius.all(Radius.circular(100)),
|
||||
child: CachedNetworkImage(
|
||||
maxHeightDiskCache: 200,
|
||||
maxWidthDiskCache: 200,
|
||||
cacheKey: country.countryName,
|
||||
key: UniqueKey(),
|
||||
imageUrl: "${ApiEndpoints.base}${country.flagIcon}",
|
||||
imageUrl:
|
||||
"${ApiEndpoints.base}${country.flagIcon}",
|
||||
height: 24.h,
|
||||
width: 24.w,
|
||||
placeholder: (context, url) => Container(
|
||||
placeholder: (context, url) => SizedBox(
|
||||
height: 24.h,
|
||||
width: 24.w,
|
||||
child: CircularProgressIndicator(),
|
||||
child: const CircularProgressIndicator(),
|
||||
),
|
||||
errorWidget: (context, url, error) =>
|
||||
Icon(Icons.error),
|
||||
const Icon(Icons.error),
|
||||
fit: BoxFit.cover),
|
||||
),
|
||||
),
|
||||
@@ -103,7 +105,8 @@ class CountrySelectionList extends StatelessWidget {
|
||||
} else if (state is CountryError) {
|
||||
return Center(child: Text(state.message));
|
||||
} else {
|
||||
return Center(child: Text('Press button to fetch country data'));
|
||||
return const Center(
|
||||
child: Text('Press button to fetch country data'));
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@@ -1,30 +1,29 @@
|
||||
import 'package:bloc/bloc.dart';
|
||||
import 'package:tanami_app/features/OTP/bloc/OTPStateEvent.dart';
|
||||
|
||||
import '../../../Api_Helper/base_manager.dart';
|
||||
import '../Repository/OTP_API.dart';
|
||||
import '../domain/Repository/otp_api.dart';
|
||||
import 'otp_event.dart';
|
||||
import 'otp_state.dart';
|
||||
|
||||
class OTPBloc extends Bloc<OTPEvent, OTPState> {
|
||||
OTPBloc() : super (OTPInitial()) {
|
||||
on<RequestOTP>(RequestOTPCall);
|
||||
OTPBloc() : super(OTPInitial()) {
|
||||
on<RequestOTP>(requestOTPCall);
|
||||
// on<VerifyOTP>(VerifyOTPCall);
|
||||
}
|
||||
Future<void> RequestOTPCall(RequestOTP event, Emitter<OTPState> emit) async {
|
||||
if (event is RequestOTP) {
|
||||
emit(OTPLoading());
|
||||
final otprequestdata = event.OTPRequestData;
|
||||
Future<void> requestOTPCall(RequestOTP event, Emitter<OTPState> emit) async {
|
||||
emit(OTPLoading());
|
||||
final otprequestdata = event.OTPRequestData;
|
||||
|
||||
try {
|
||||
ResponseData response = await OTPAPI().RequestOTP(otprequestdata);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
emit(OTPLoaded());
|
||||
} else {
|
||||
emit(OTPFailed("Oops something went wrong"));
|
||||
}
|
||||
print("//");
|
||||
} catch (e) {
|
||||
emit(OTPError("Oops something went wrong"));
|
||||
try {
|
||||
ResponseData response = await OTPAPI().requestOTP(otprequestdata);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
emit(OTPLoaded());
|
||||
} else {
|
||||
emit(OTPFailed("Oops something went wrong"));
|
||||
}
|
||||
print("//");
|
||||
} catch (e) {
|
||||
emit(OTPError("Oops something went wrong"));
|
||||
}
|
||||
}
|
||||
|
||||
17
lib/features/otpVerification/bloc/otp_event.dart
Normal file
17
lib/features/otpVerification/bloc/otp_event.dart
Normal file
@@ -0,0 +1,17 @@
|
||||
abstract class OTPEvent {
|
||||
const OTPEvent();
|
||||
|
||||
List<Object> get props => [];
|
||||
}
|
||||
|
||||
class RequestOTP extends OTPEvent {
|
||||
final Map<String, dynamic> OTPRequestData;
|
||||
RequestOTP(this.OTPRequestData);
|
||||
|
||||
@override
|
||||
List<Object> get props => [OTPRequestData];
|
||||
}
|
||||
|
||||
class VerifyOTP extends OTPEvent {
|
||||
VerifyOTP();
|
||||
}
|
||||
19
lib/features/otpVerification/bloc/otp_state.dart
Normal file
19
lib/features/otpVerification/bloc/otp_state.dart
Normal file
@@ -0,0 +1,19 @@
|
||||
abstract class OTPState {}
|
||||
|
||||
class OTPInitial extends OTPState {}
|
||||
|
||||
class OTPLoading extends OTPState {}
|
||||
|
||||
class OTPLoaded extends OTPState {}
|
||||
|
||||
class OTPFailed extends OTPState {
|
||||
final String failedmessage;
|
||||
|
||||
OTPFailed(this.failedmessage);
|
||||
}
|
||||
|
||||
class OTPError extends OTPState {
|
||||
final String errormessage;
|
||||
|
||||
OTPError(this.errormessage);
|
||||
}
|
||||
@@ -1,21 +1,22 @@
|
||||
import '../../../../Api_Helper/base_manager.dart';
|
||||
import '../../../../shared/api/api_endpoints.dart';
|
||||
import '../../../../shared/api/network_api_services.dart';
|
||||
import '../../../../../Api_Helper/base_manager.dart';
|
||||
import '../../../../../shared/api/api_endpoints.dart';
|
||||
import '../../../../../shared/api/network_api_services.dart';
|
||||
|
||||
class OTPAPI {
|
||||
OTPAPI();
|
||||
Future<ResponseData> RequestOTP(Map<String, dynamic> data) async {
|
||||
Future<ResponseData> requestOTP(Map<String, dynamic> data) async {
|
||||
String url = ApiEndpoints.requestotpapi;
|
||||
final response = await NetworkApiService().post(url, data);
|
||||
return response;
|
||||
}
|
||||
Future<ResponseData> ResendOTPRequest(Map<String, dynamic> data) async {
|
||||
|
||||
Future<ResponseData> resendOTPRequest(Map<String, dynamic> data) async {
|
||||
String url = ApiEndpoints.requestresendotp;
|
||||
final response = await NetworkApiService().post(url, data);
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData> VerifyOTP(Map<String, dynamic> data) async {
|
||||
Future<ResponseData> verifyOTP(Map<String, dynamic> data) async {
|
||||
String url = ApiEndpoints.verifyotp;
|
||||
final response = await NetworkApiService().post(url, data);
|
||||
return response;
|
||||
@@ -4,7 +4,8 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:sms_autofill/sms_autofill.dart';
|
||||
import 'package:tanami_app/Api_Helper/base_manager.dart';
|
||||
import 'package:tanami_app/Globalconst.dart';
|
||||
import '../../../OTP/Repository/OTP_API.dart';
|
||||
|
||||
import '../../domain/Repository/otp_api.dart';
|
||||
import 'otp_event.dart';
|
||||
import 'otp_state.dart';
|
||||
|
||||
@@ -31,14 +32,14 @@ class OtpBloc extends Bloc<OtpEvent, OtpState> {
|
||||
void _onOtpSubmit(OtpSubmit event, Emitter<OtpState> emit) async {
|
||||
emit(OtpSubmitting());
|
||||
try {
|
||||
Map<String,dynamic> otpdata= {
|
||||
"token":Globalconst.token,
|
||||
"otp":otpController.text
|
||||
Map<String, dynamic> otpdata = {
|
||||
"token": Globalconst.token,
|
||||
"otp": otpController.text
|
||||
};
|
||||
ResponseData response= await OTPAPI().VerifyOTP(otpdata);
|
||||
ResponseData response = await OTPAPI().verifyOTP(otpdata);
|
||||
// Add your OTP verification logic here
|
||||
// await Future.delayed(const Duration(seconds: 2));
|
||||
if (response.status==ResponseStatus.SUCCESS) {
|
||||
// await Future.delayed(const Duration(seconds: 2));
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
emit(OtpSubmissionSuccess());
|
||||
} else {
|
||||
emit(const OtpSubmissionFailure("Otp Invalid !"));
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.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';
|
||||
@@ -24,9 +22,9 @@ class ResendOtpSection extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
String token = "";
|
||||
var loginBloc = context.read<RegisterBloc>();
|
||||
loginBloc.isdcode=Globalconst.isdcode;
|
||||
loginBloc.phoneNumberTextField.text=Globalconst.phonenumber;
|
||||
loginBloc.countrySelectionTextField.text=Globalconst.name;
|
||||
loginBloc.isdcode = Globalconst.isdcode;
|
||||
loginBloc.phoneNumberTextField.text = Globalconst.phonenumber;
|
||||
loginBloc.countrySelectionTextField.text = Globalconst.name;
|
||||
var localizations = AppLocalizations.of(context);
|
||||
return BlocBuilder<TimerBloc, TimerState>(
|
||||
builder: (context, state) {
|
||||
@@ -45,14 +43,14 @@ class ResendOtpSection extends StatelessWidget {
|
||||
if (state is RegisterLoading) {
|
||||
Loader.loader(context);
|
||||
} else if (state is RegisterSuccess) {
|
||||
successToastMessage(context, "OTP Resend Sucessfully !");
|
||||
successToastMessage(context, "OTP Resend Sucessfully !");
|
||||
goRouter.pop();
|
||||
} else if (state is RegisterFailure) {
|
||||
goRouter.pop();
|
||||
errorToastMessage(
|
||||
context,
|
||||
state.error,
|
||||
);
|
||||
context,
|
||||
state.error,
|
||||
);
|
||||
}
|
||||
},
|
||||
builder: (context, state) {
|
||||
@@ -66,11 +64,11 @@ class ResendOtpSection extends StatelessWidget {
|
||||
}
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
loginBloc.add(
|
||||
loginBloc.add(
|
||||
Resendotp(Globalconst.token),
|
||||
);
|
||||
print("///");
|
||||
|
||||
|
||||
// successToastMessage(context, "OTP Resend Sucessfully !");
|
||||
},
|
||||
child: TextWidget().text14W500(
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import 'package:bloc/bloc.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../Api_Helper/base_manager.dart';
|
||||
import '../../../../Globalconst.dart';
|
||||
import '../../../OTP/Repository/OTP_API.dart';
|
||||
import '../../../otpVerification/domain/Repository/otp_api.dart';
|
||||
import 'register_event.dart';
|
||||
import 'register_state.dart';
|
||||
|
||||
@@ -32,13 +33,13 @@ class RegisterBloc extends Bloc<RegisterEvent, RegisterState> {
|
||||
"countryId":event.id,
|
||||
"phoneNumber":event.phoneNumber
|
||||
};
|
||||
ResponseData response = await OTPAPI().RequestOTP(requestdata);
|
||||
ResponseData response = await OTPAPI().requestOTP(requestdata);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
print("///////success");
|
||||
var data=response.data["data"];
|
||||
String token=data["token"];
|
||||
Globalconst.token=token;
|
||||
emit(RegisterSuccess(token));//emit(OTPLoaded());
|
||||
var data = response.data["data"];
|
||||
String token = data["token"];
|
||||
Globalconst.token = token;
|
||||
emit(RegisterSuccess(token)); //emit(OTPLoaded());
|
||||
} else {
|
||||
emit(const RegisterFailure(
|
||||
"Register failed. Please check your credentials."));
|
||||
@@ -49,15 +50,15 @@ class RegisterBloc extends Bloc<RegisterEvent, RegisterState> {
|
||||
}
|
||||
});
|
||||
|
||||
on<Resendotp>((event, emit) async {
|
||||
on<Resendotp>((event, emit) async {
|
||||
emit(RegisterLoading());
|
||||
try {
|
||||
Map<String,dynamic> requestdata={
|
||||
"token":Globalconst.token,
|
||||
Map<String, dynamic> requestdata = {
|
||||
"token": Globalconst.token,
|
||||
};
|
||||
ResponseData response = await OTPAPI().ResendOTPRequest(requestdata);
|
||||
ResponseData response = await OTPAPI().resendOTPRequest(requestdata);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
emit(RegisterSuccess(event.token));//emit(OTPLoaded());
|
||||
emit(RegisterSuccess(event.token)); //emit(OTPLoaded());
|
||||
} else {
|
||||
emit(const RegisterFailure(
|
||||
"Register failed. Please check your credentials."));
|
||||
|
||||
@@ -4,13 +4,13 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:tanami_app/core/styles/app_text.dart';
|
||||
import 'package:tanami_app/features/countrySelection/bloc/GetCountry/getcountryevent_bloc.dart';
|
||||
|
||||
import '../../../../Globalconst.dart';
|
||||
import '../../../../core/utils/language/localizations_delegate.dart';
|
||||
import '../../../../shared/api/api_endpoints.dart';
|
||||
import '../../../../shared/components/form_label_textfield.dart';
|
||||
import '../../../countrySelection/bloc/GetCountry/getcountry_bloc.dart';
|
||||
import '../../../countrySelection/bloc/GetCountry/get_country_bloc.dart';
|
||||
import '../../../countrySelection/bloc/GetCountry/get_country_state.dart';
|
||||
import '../../../countrySelection/bloc/choose_country_bloc.dart';
|
||||
import '../../../countrySelection/bloc/choose_country_state.dart';
|
||||
import '../bloc/register_bloc.dart';
|
||||
@@ -39,13 +39,14 @@ class RegisterForm extends StatelessWidget {
|
||||
loginBloc.countryId="${countryState.countryModel.data![selectedCountry].id}";
|
||||
flag =
|
||||
"${ApiEndpoints.base}${countryState.countryModel.data![selectedCountry].flagIcon}";
|
||||
Globalconst.phonenumber=loginBloc.phoneNumberTextField.text;
|
||||
Globalconst.phonenumber = loginBloc.phoneNumberTextField.text;
|
||||
|
||||
Globalconst.name=countryState
|
||||
Globalconst.name = countryState
|
||||
.countryModel.data![selectedCountry].countryName
|
||||
.toString();
|
||||
Globalconst.isdcode="${countryState.countryModel.data![selectedCountry].isdCode}";
|
||||
}
|
||||
Globalconst.isdcode =
|
||||
"${countryState.countryModel.data![selectedCountry].isdCode}";
|
||||
}
|
||||
}
|
||||
}, builder: (context, state) {
|
||||
if (state is RadioSelectionChanged) {
|
||||
@@ -69,8 +70,8 @@ class RegisterForm extends StatelessWidget {
|
||||
prefixWidget: selectedCountry == -1
|
||||
? null
|
||||
: Padding(
|
||||
padding: EdgeInsets.only(left: 12.w),
|
||||
child: SizedBox(
|
||||
padding: EdgeInsets.only(left: 12.w),
|
||||
child: SizedBox(
|
||||
height: 50.h,
|
||||
width: 30.w,
|
||||
child: Align(
|
||||
@@ -79,8 +80,8 @@ class RegisterForm extends StatelessWidget {
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
child: ClipRRect(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(100)),
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(100)),
|
||||
child: CachedNetworkImage(
|
||||
maxHeightDiskCache: 200,
|
||||
maxWidthDiskCache: 200,
|
||||
@@ -90,19 +91,20 @@ class RegisterForm extends StatelessWidget {
|
||||
imageUrl: flag,
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
placeholder: (context, url) => Container(
|
||||
placeholder: (context, url) => SizedBox(
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
child: CircularProgressIndicator(),
|
||||
child:
|
||||
const CircularProgressIndicator(),
|
||||
),
|
||||
errorWidget: (context, url, error) =>
|
||||
Icon(Icons.error),
|
||||
const Icon(Icons.error),
|
||||
fit: BoxFit.cover),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
/* Image.asset(
|
||||
countryFlag[selectedCountry],
|
||||
width: 20,
|
||||
@@ -115,11 +117,11 @@ class RegisterForm extends StatelessWidget {
|
||||
),
|
||||
const Gap(20),
|
||||
FormLabelTextField(
|
||||
prefixWidget: selectedCountry == -1 ||flag.isEmpty
|
||||
prefixWidget: selectedCountry == -1 || flag.isEmpty
|
||||
? null
|
||||
: Padding(
|
||||
padding: EdgeInsets.only(left: 12.w),
|
||||
child: SizedBox(
|
||||
: Padding(
|
||||
padding: EdgeInsets.only(left: 12.w),
|
||||
child: SizedBox(
|
||||
height: 50.h,
|
||||
width: 30.w,
|
||||
child: Align(
|
||||
@@ -128,8 +130,8 @@ class RegisterForm extends StatelessWidget {
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
child: ClipRRect(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(100)),
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(100)),
|
||||
child: CachedNetworkImage(
|
||||
maxHeightDiskCache: 200,
|
||||
maxWidthDiskCache: 200,
|
||||
@@ -139,19 +141,21 @@ class RegisterForm extends StatelessWidget {
|
||||
imageUrl: flag,
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
placeholder: (context, url) => Container(
|
||||
placeholder: (context, url) => SizedBox(
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
child: CircularProgressIndicator(),
|
||||
child:
|
||||
const CircularProgressIndicator(),
|
||||
),
|
||||
errorWidget: (context, url, error) =>
|
||||
Icon(Icons.error),
|
||||
const Icon(Icons.error),
|
||||
fit: BoxFit.cover),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),/* Image.asset(
|
||||
),
|
||||
/* Image.asset(
|
||||
countryFlag[selectedCountry],
|
||||
width: 20,
|
||||
height: 20,
|
||||
|
||||
@@ -25,7 +25,7 @@ class SplashLayout extends StatelessWidget {
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
/* Positioned.fill(
|
||||
Positioned.fill(
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: SvgPicture.asset(
|
||||
@@ -39,7 +39,7 @@ class SplashLayout extends StatelessWidget {
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: BottomVersionWidget(),
|
||||
),
|
||||
), */
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -5,8 +5,8 @@ import 'package:gap/gap.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_color.dart';
|
||||
import 'package:tanami_app/features/countrySelection/bloc/GetCountry/getcountry_bloc.dart';
|
||||
import 'package:tanami_app/features/countrySelection/bloc/GetCountry/getcountryevent_bloc.dart';
|
||||
import 'package:tanami_app/features/countrySelection/bloc/GetCountry/get_country_bloc.dart';
|
||||
import 'package:tanami_app/features/countrySelection/bloc/GetCountry/get_country_event.dart';
|
||||
import 'package:tanami_app/shared/components/button_widget.dart';
|
||||
|
||||
import '../../../../core/styles/app_text.dart';
|
||||
@@ -31,7 +31,7 @@ class LoginSignUpButton extends StatelessWidget {
|
||||
height: 56.h,
|
||||
child: ButtonWidget().elevatedBtn(
|
||||
function: () {
|
||||
context.read<GetCountryBlock>().add(GetCountry());
|
||||
context.read<GetCountryBlock>().add(GetCountry());
|
||||
goRouter.goNamed(RouteName.registerStepScreen, pathParameters: {
|
||||
"fromScreentype": "welcome",
|
||||
});
|
||||
|
||||
@@ -9,16 +9,11 @@ import 'core/routes/routes.dart';
|
||||
import 'core/utils/connectivity/network_connectivity.dart';
|
||||
import 'core/utils/language/localizations_delegate.dart';
|
||||
import 'core/utils/secure/secure_storage_service.dart';
|
||||
import 'features/OTP/bloc/OTP_bloc.dart';
|
||||
import 'features/biometric/presentation/bloc/biometric_bloc.dart';
|
||||
import 'features/biometric/presentation/bloc/biometric_event.dart';
|
||||
import 'features/countrySelection/bloc/GetCountry/getcountry_bloc.dart';
|
||||
import 'features/countrySelection/bloc/GetCountry/get_country_bloc.dart';
|
||||
import 'features/countrySelection/bloc/choose_country_bloc.dart';
|
||||
import 'features/otpVerification/presentation/bloc/otp_bloc.dart';
|
||||
import 'features/otpVerification/presentation/bloc/otp_event.dart';
|
||||
import 'features/otpVerification/presentation/bloc/timer/timer_bloc.dart';
|
||||
import 'features/otpVerification/presentation/bloc/timer/timer_event.dart';
|
||||
import 'features/register/presentation/bloc/register_bloc.dart';
|
||||
import 'features/otpVerification/bloc/otp_bloc.dart';
|
||||
import 'shared/components/bloc/bottom_nav_bar/bottom_navigation_bloc.dart';
|
||||
import 'shared/components/bloc/language/lng_bloc.dart';
|
||||
import 'shared/components/bloc/language/lng_event.dart';
|
||||
@@ -114,7 +109,6 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
BlocProvider(
|
||||
create: (_) => OTPBloc(),
|
||||
),
|
||||
|
||||
],
|
||||
child: ScreenUtilInit(
|
||||
builder: (BuildContext context, Widget? child) =>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
class ApiEndpoints {
|
||||
static const base="https://tanami.betadelivery.com/";
|
||||
static const base = "https://tanami.betadelivery.com/";
|
||||
static const baseurl =
|
||||
"https://tanami.betadelivery.com/api/development/v1/"; //App Base url
|
||||
|
||||
static const getcountryurl = baseurl + "country/getAllCountry";
|
||||
static const requestotpapi=baseurl +"auth/public/register";
|
||||
static const requestresendotp=baseurl+"auth/public/resend-otp";
|
||||
static const verifyotp=baseurl+"auth/public/verify-otp";
|
||||
static const getcountryurl = "${baseurl}country/getAllCountry";
|
||||
static const requestotpapi = "${baseurl}auth/public/register";
|
||||
static const requestresendotp = "${baseurl}auth/public/resend-otp";
|
||||
static const verifyotp = "${baseurl}auth/public/verify-otp";
|
||||
}
|
||||
|
||||
@@ -88,10 +88,11 @@ class TextWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget text13W500(String text, {Color? clr}) {
|
||||
Widget text13W500(String text, {Color? clr, FontStyle? fontStyle}) {
|
||||
return Text(
|
||||
text,
|
||||
style: GoogleFonts.dmSans(
|
||||
fontStyle: fontStyle ?? FontStyle.normal,
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: clr ?? AppColor.plainWhite,
|
||||
|
||||
Reference in New Issue
Block a user