|
| 1 | +import 'package:flutter/cupertino.dart'; |
1 | 2 | import 'package:flutter/material.dart'; |
2 | 3 | import 'package:google_fonts/google_fonts.dart'; |
3 | 4 | import 'package:jin_ecomm/src/utils/text_util.dart'; |
@@ -27,71 +28,75 @@ class PaymentGateway extends StatelessWidget { |
27 | 28 | } |
28 | 29 |
|
29 | 30 | return Scaffold( |
30 | | - appBar: AppBar( |
31 | | - elevation: 0, |
32 | | - backgroundColor: Colors.grey.shade300, |
33 | | - title: Text("Payment gateway", style: GoogleFonts.alatsi( |
34 | | - fontSize: 20, |
35 | | - color: Colors.black87, |
36 | | - fontWeight: FontWeight.bold, |
37 | | - ),), |
38 | | - centerTitle: true, |
39 | | - leading: GestureDetector( |
40 | | - onTap: ()=>{ |
41 | | - Navigator.pop(context) |
42 | | - }, |
43 | | - child: Icon(Icons.arrow_back_ios)), |
44 | | - ), |
| 31 | + appBar: buildAppBar(context), |
45 | 32 | body: Container( |
46 | | - padding: EdgeInsets.all(12), |
| 33 | + padding: EdgeInsets.only(top: 0, left: 10, right: 10), |
47 | 34 | child: Column( |
48 | 35 | crossAxisAlignment: CrossAxisAlignment.start, |
49 | 36 | children: [ |
50 | | - SizedBox( |
51 | | - height: 20, |
52 | | - ), |
53 | 37 | Expanded( |
54 | 38 | child: ListView.builder( |
55 | 39 | itemCount: _getPaymentCards().length, |
56 | 40 | itemBuilder: (BuildContext context, int index) { |
57 | 41 | return Card( |
58 | | - color: Colors.grey.shade200, |
| 42 | + color: Colors.grey.shade400, |
59 | 43 | child: Padding( |
60 | | - padding: EdgeInsets.all(10), |
61 | | - child: Row( |
62 | | - mainAxisAlignment: MainAxisAlignment.spaceBetween, |
63 | | - children: [ |
64 | | - |
65 | | - Column( |
66 | | - crossAxisAlignment: CrossAxisAlignment.start, |
67 | | - children: [ |
68 | | - Text( |
69 | | - _getPaymentCards()[index].title, |
70 | | - style: largeText, |
71 | | - ), |
72 | | - Text( |
73 | | - "Pay bill using ${_getPaymentCards()[index].title}", |
74 | | - style: smallText, |
75 | | - ), |
76 | | - ], |
77 | | - ), |
78 | | - |
79 | | - CircleAvatar( |
80 | | - radius: 60, |
81 | | - backgroundColor: Colors.pink, |
82 | | - child: Image.asset(_getPaymentCards()[index].image), |
83 | | - ) |
84 | | - |
85 | | - ], |
86 | | - ) |
87 | | - ), |
| 44 | + padding: EdgeInsets.all(8), |
| 45 | + child: Row( |
| 46 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, |
| 47 | + children: [ |
| 48 | + Column( |
| 49 | + crossAxisAlignment: CrossAxisAlignment.start, |
| 50 | + children: [ |
| 51 | + Text( |
| 52 | + _getPaymentCards()[index].title, |
| 53 | + style: TextStyle( |
| 54 | + fontSize: 14, |
| 55 | + fontWeight: FontWeight.bold), |
| 56 | + ), |
| 57 | + Text( |
| 58 | + "Pay bill using ${_getPaymentCards()[index].title}", |
| 59 | + style: smallText, |
| 60 | + ), |
| 61 | + ], |
| 62 | + ), |
| 63 | + CircleAvatar( |
| 64 | + radius: 20, |
| 65 | + backgroundColor: Colors.pink, |
| 66 | + child: Image.asset( |
| 67 | + _getPaymentCards()[index].image), |
| 68 | + ) |
| 69 | + ], |
| 70 | + )), |
88 | 71 | ); |
89 | 72 | })) |
90 | 73 | ], |
91 | 74 | ), |
92 | 75 | ), |
93 | 76 | ); |
94 | 77 | } |
| 78 | + |
| 79 | + AppBar buildAppBar(BuildContext context) { |
| 80 | + return AppBar( |
| 81 | + elevation: 0, |
| 82 | + backgroundColor: Colors.grey.shade200, |
| 83 | + title: Text( |
| 84 | + "PAYMENT", |
| 85 | + style: GoogleFonts.lato( |
| 86 | + fontSize: 20, |
| 87 | + color: Colors.black87, |
| 88 | + fontWeight: FontWeight.bold, |
| 89 | + ), |
| 90 | + ), |
| 91 | + centerTitle: true, |
| 92 | + leading: GestureDetector( |
| 93 | + onTap: () => {Navigator.pop(context)}, |
| 94 | + child: Icon( |
| 95 | + CupertinoIcons.back, |
| 96 | + color: Colors.black38, |
| 97 | + )), |
| 98 | + ); |
| 99 | + } |
95 | 100 | } |
96 | 101 |
|
97 | 102 | class PayCard { |
|
0 commit comments