Skip to content

Commit 6594ee1

Browse files
shaileshmishrashaileshmishra
authored andcommitted
home page updated
1 parent b2592a9 commit 6594ee1

File tree

2 files changed

+68
-56
lines changed

2 files changed

+68
-56
lines changed

lib/src/view/home_page.dart

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ class _HomePageState extends State<HomePage> {
3232

3333
Container buildCategoryListView() {
3434
return Container(
35-
height: 210,
35+
height: 150,
3636
width: double.infinity,
37-
child: buildProductListView(),
37+
child: renderProductCategories(),
3838
);
3939
}
4040

@@ -121,7 +121,7 @@ class _HomePageState extends State<HomePage> {
121121
);
122122
}
123123

124-
ListView buildProductListView() {
124+
ListView renderProductCategories() {
125125
return ListView.builder(
126126
padding: EdgeInsets.only(left: 0),
127127
itemCount: productList.length,
@@ -136,7 +136,7 @@ class _HomePageState extends State<HomePage> {
136136
product: productList[index],
137137
))),
138138
},
139-
child: Container(width: 300, child: buildCardGrid(index)),
139+
child: Container(width: 100, child: buildCardGrid(index)),
140140
);
141141
});
142142
}
@@ -168,22 +168,29 @@ class _HomePageState extends State<HomePage> {
168168
Card buildCardGrid(int index) {
169169
return Card(
170170
elevation: 0,
171+
color: productList[index].color,
171172
child: new GridTile(
172173
footer: Padding(
173-
padding: EdgeInsets.all(10),
174+
padding: EdgeInsets.all(6),
174175
child: Row(
175176
mainAxisAlignment: MainAxisAlignment.spaceBetween,
176177
children: [
177-
Text(productList[index].title),
178+
Text(
179+
productList[index].title,
180+
style: TextStyle(fontSize: 10),
181+
),
178182
CircleAvatar(
179183
backgroundColor: productList[index].color,
180-
radius: 10,
184+
radius: 8,
181185
)
182186
],
183187
)),
184188
child: Padding(
185189
padding: EdgeInsets.all(10),
186-
child: Image.asset(productList[index].image),
190+
child: Image.asset(
191+
productList[index].image,
192+
fit: BoxFit.contain,
193+
),
187194
), //just for testing, will fill with image later
188195
),
189196
);

lib/src/view/payment_gateway.dart

Lines changed: 53 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'package:flutter/cupertino.dart';
12
import 'package:flutter/material.dart';
23
import 'package:google_fonts/google_fonts.dart';
34
import 'package:jin_ecomm/src/utils/text_util.dart';
@@ -27,71 +28,75 @@ class PaymentGateway extends StatelessWidget {
2728
}
2829

2930
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),
4532
body: Container(
46-
padding: EdgeInsets.all(12),
33+
padding: EdgeInsets.only(top: 0, left: 10, right: 10),
4734
child: Column(
4835
crossAxisAlignment: CrossAxisAlignment.start,
4936
children: [
50-
SizedBox(
51-
height: 20,
52-
),
5337
Expanded(
5438
child: ListView.builder(
5539
itemCount: _getPaymentCards().length,
5640
itemBuilder: (BuildContext context, int index) {
5741
return Card(
58-
color: Colors.grey.shade200,
42+
color: Colors.grey.shade400,
5943
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+
)),
8871
);
8972
}))
9073
],
9174
),
9275
),
9376
);
9477
}
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+
}
95100
}
96101

97102
class PayCard {

0 commit comments

Comments
 (0)