|
1 | 1 | import 'package:flutter/material.dart'; |
2 | | -import 'package:flutter_ecommerce_app/helper/_utils.dart'; |
3 | | -import 'package:flutter_ecommerce_app/models/_payment_cart_model.dart'; |
| 2 | +import 'package:flutter_ecommerce_app/components/_close_activity.dart'; |
| 3 | +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; |
| 4 | +import 'package:get/get.dart'; |
4 | 5 |
|
5 | | -Container returnBody(payemnts) { |
6 | | - return Container( |
7 | | - padding: EdgeInsets.all(20), |
8 | | - child: ListView.builder( |
9 | | - itemCount: payemnts.length, |
10 | | - itemBuilder: (context, index) { |
11 | | - return _paycardView(payemnts[index]); |
12 | | - }), |
13 | | - ); |
14 | | -} |
| 6 | +import '../../../constant.dart'; |
15 | 7 |
|
16 | | -Card _paycardView(PayCard payemnt) { |
17 | | - return Card( |
18 | | - color: Colors.grey.shade400, |
19 | | - child: Padding( |
20 | | - padding: EdgeInsets.all(20), |
21 | | - child: Row( |
22 | | - mainAxisAlignment: MainAxisAlignment.spaceBetween, |
| 8 | +Container choosePaymentType() { |
| 9 | + return Container( |
| 10 | + padding: EdgeInsets.symmetric(horizontal: 30), |
| 11 | + child: Column( |
| 12 | + crossAxisAlignment: CrossAxisAlignment.start, |
| 13 | + children: [ |
| 14 | + Text( |
| 15 | + 'Choose payemnt method', |
| 16 | + style: TextStyle( |
| 17 | + color: Colors.black, fontWeight: FontWeight.bold, fontSize: 16), |
| 18 | + ), |
| 19 | + SizedBox(height: 20), |
| 20 | + paymenOptions(), |
| 21 | + SizedBox(height: 30), |
| 22 | + Text( |
| 23 | + 'Promo Code', |
| 24 | + style: TextStyle( |
| 25 | + color: Colors.black, fontWeight: FontWeight.bold, fontSize: 16), |
| 26 | + ), |
| 27 | + SizedBox(height: 20), |
| 28 | + promoCodeWidget(), |
| 29 | + SizedBox(height: 120), |
| 30 | + Row( |
23 | 31 | children: [ |
24 | | - Column( |
25 | | - crossAxisAlignment: CrossAxisAlignment.start, |
26 | | - children: [ |
27 | | - Text( |
28 | | - payemnt.title, |
29 | | - style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold), |
30 | | - ), |
31 | | - Text( |
32 | | - "Pay bill using ${payemnt.title}", |
33 | | - style: smallText, |
34 | | - ), |
35 | | - ], |
| 32 | + Text( |
| 33 | + 'Total payment', |
| 34 | + style: TextStyle(color: Colors.black, fontSize: 16), |
| 35 | + ), |
| 36 | + Spacer(), |
| 37 | + Text( |
| 38 | + '\$500.99', |
| 39 | + style: TextStyle( |
| 40 | + color: Colors.black, |
| 41 | + fontWeight: FontWeight.bold, |
| 42 | + fontSize: 18), |
36 | 43 | ), |
37 | | - imgThumbnail(payemnt) |
38 | 44 | ], |
39 | | - )), |
| 45 | + ), |
| 46 | + SizedBox(height: 30), |
| 47 | + Container( |
| 48 | + height: 45, |
| 49 | + width: double.infinity, |
| 50 | + child: OutlinedButton( |
| 51 | + style: OutlinedButton.styleFrom( |
| 52 | + backgroundColor: Colors.black, |
| 53 | + shape: RoundedRectangleBorder( |
| 54 | + borderRadius: BorderRadius.circular(25.0), |
| 55 | + ), |
| 56 | + side: BorderSide(width: 2, color: Colors.grey.shade500), |
| 57 | + ), |
| 58 | + onPressed: () { |
| 59 | + Get.snackbar("Processing", 'Payment is processing', |
| 60 | + animationDuration: Duration(seconds: 2)); |
| 61 | + }, |
| 62 | + child: Text( |
| 63 | + 'PAY', |
| 64 | + style: TextStyle(color: Colors.white), |
| 65 | + ), |
| 66 | + ), |
| 67 | + ) |
| 68 | + ], |
| 69 | + ), |
| 70 | + ); |
| 71 | +} |
| 72 | + |
| 73 | +Row paymenOptions() { |
| 74 | + return Row( |
| 75 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, |
| 76 | + children: [ |
| 77 | + CircleAvatar( |
| 78 | + maxRadius: 25, child: FaIcon(FontAwesomeIcons.amazonPay, size: 35)), |
| 79 | + FaIcon(FontAwesomeIcons.ccVisa, size: 35), |
| 80 | + FaIcon(FontAwesomeIcons.paypal, size: 35), |
| 81 | + FaIcon(FontAwesomeIcons.apple, size: 35), |
| 82 | + FaIcon(FontAwesomeIcons.donate, size: 35), |
| 83 | + ], |
40 | 84 | ); |
41 | 85 | } |
42 | 86 |
|
43 | | -CircleAvatar imgThumbnail(PayCard payemnt) { |
44 | | - return CircleAvatar( |
45 | | - radius: 20, |
46 | | - backgroundColor: Colors.pink, |
47 | | - child: Image.asset(payemnt.image), |
| 87 | +Padding creditcardImage() { |
| 88 | + return Padding( |
| 89 | + padding: EdgeInsets.all(30), |
| 90 | + child: Container( |
| 91 | + padding: EdgeInsets.all(20), |
| 92 | + height: 200, |
| 93 | + width: double.infinity, |
| 94 | + decoration: creditcardDecoration(), |
| 95 | + child: creditCardView(), |
| 96 | + ), |
48 | 97 | ); |
49 | 98 | } |
| 99 | + |
| 100 | +AppBar payActionbar() { |
| 101 | + return AppBar( |
| 102 | + elevation: 0, |
| 103 | + backgroundColor: Colors.white, |
| 104 | + leading: closeActivity(), |
| 105 | + ); |
| 106 | +} |
| 107 | + |
| 108 | +Container promoCodeWidget() { |
| 109 | + return Container( |
| 110 | + width: double.infinity, |
| 111 | + height: 40, |
| 112 | + clipBehavior: Clip.none, |
| 113 | + decoration: BoxDecoration( |
| 114 | + color: Colors.grey.shade300, |
| 115 | + borderRadius: BorderRadius.all(Radius.circular(20))), |
| 116 | + child: Align( |
| 117 | + alignment: Alignment.centerRight, |
| 118 | + child: OutlinedButton( |
| 119 | + style: OutlinedButton.styleFrom( |
| 120 | + backgroundColor: Colors.black, |
| 121 | + shape: RoundedRectangleBorder( |
| 122 | + borderRadius: BorderRadius.circular(18.0), |
| 123 | + ), |
| 124 | + side: BorderSide(width: 2, color: Colors.black), |
| 125 | + ), |
| 126 | + onPressed: () {}, |
| 127 | + child: Text( |
| 128 | + 'Apply', |
| 129 | + style: TextStyle(color: Colors.white), |
| 130 | + ), |
| 131 | + ), |
| 132 | + ), |
| 133 | + ); |
| 134 | +} |
| 135 | + |
| 136 | +Column creditCardView() { |
| 137 | + return Column( |
| 138 | + crossAxisAlignment: CrossAxisAlignment.start, |
| 139 | + children: [ |
| 140 | + Text( |
| 141 | + 'Credit Card', |
| 142 | + style: TextStyle( |
| 143 | + color: Colors.white, |
| 144 | + ), |
| 145 | + ), |
| 146 | + Spacer(), |
| 147 | + Text( |
| 148 | + '3763 4367 7346 0046', |
| 149 | + style: TextStyle( |
| 150 | + color: Colors.white, |
| 151 | + fontSize: 18, |
| 152 | + ), |
| 153 | + ), |
| 154 | + SizedBox(height: kSpace), |
| 155 | + Row( |
| 156 | + children: [ |
| 157 | + Text( |
| 158 | + 'Shailesh Mishra', |
| 159 | + style: TextStyle( |
| 160 | + color: Colors.white, |
| 161 | + ), |
| 162 | + ), |
| 163 | + Spacer(), |
| 164 | + Icon( |
| 165 | + Icons.ac_unit_outlined, |
| 166 | + ) |
| 167 | + ], |
| 168 | + ) |
| 169 | + ], |
| 170 | + ); |
| 171 | +} |
| 172 | + |
| 173 | +BoxDecoration creditcardDecoration() { |
| 174 | + return BoxDecoration( |
| 175 | + color: Colors.grey.shade800, |
| 176 | + borderRadius: BorderRadius.all( |
| 177 | + Radius.circular(20), |
| 178 | + )); |
| 179 | +} |
0 commit comments