-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome_page.dart
225 lines (216 loc) · 8.2 KB
/
home_page.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
import 'package:flutter/material.dart';
class HomePage extends StatefulWidget {
const HomePage({ super.key});
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
String currentMall = 'Delhi Mart'; // Initial mall name
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Color(0xFFBD1F1F),
title: Text('SHOPEZ',
style: TextStyle(fontSize: 30)),
bottom: PreferredSize(
preferredSize: Size.fromHeight(30.0),
child: Padding(
padding: const EdgeInsets.all(8),
child: Text(
"Checkout at your fingertips",
style: TextStyle(fontSize: 16, color: Colors.white)
),
),
),
),
drawer: Drawer(
child: Container(
color: Color(0x900B0B).withOpacity(0.8),
child: ListView(
children: [
ListTile(
title: Text("MENU", style: TextStyle(color: Colors.white, fontSize: 30, fontWeight: FontWeight.bold)),
onTap: (){},
),
SizedBox(height: 10,),
Divider(color: Colors.white),
ListTile(
leading: Icon(Icons.account_circle_outlined, size: 32, color: Colors.white,),
title: Text("Account Info", style: TextStyle(color: Colors.white, fontSize: 23)),
onTap: (){},
),
Divider(color: Colors.white),
ListTile(
leading: Icon(Icons.history, size: 32, color: Colors.white),
title: Text("Payment History", style: TextStyle(color: Colors.white, fontSize: 23)),
onTap: (){},
),
Divider(color: Colors.white),
ListTile(
leading: Icon(Icons.local_offer_outlined, size: 32, color: Colors.white),
title: Text("Offers", style: TextStyle(color: Colors.white, fontSize: 23)),
onTap: (){},
),
Divider(color: Colors.white),
ListTile(
leading: Icon(Icons.help_outline_rounded, size: 32, color: Colors.white),
title: Text("Help", style: TextStyle(color: Colors.white, fontSize: 23)),
onTap: (){},
),
Divider(color: Colors.white),
ListTile(
leading: Icon(Icons.logout_rounded, size: 32, color: Colors.white),
title: Text("Logout", style: TextStyle(color: Colors.white, fontSize: 23)),
onTap: (){},
),
Divider(color: Colors.white),
],
),
),
),
body: SafeArea(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
const SizedBox(height: 20,),
Image.asset(
'lib/images/groceries.jpg',
height: 200,
),
SizedBox(height: 15,),
Text(
"Currently Shopping in",
style: TextStyle(color: Colors.black, fontSize: 20),
),
SizedBox(height: 10,),
ElevatedButton(
onPressed: () {
// Show dialog or bottom sheet to change mall
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: Text('Select Mall', style: TextStyle(fontSize: 20),),
content: SingleChildScrollView(
child: ListBody(
children: <Widget>[
GestureDetector(
child: Text('Mall 1',style: TextStyle(fontSize: 20),),
onTap: () {
setState(() {
currentMall = 'Mall 1';
});
Navigator.of(context).pop();
},
),
GestureDetector(
child: Text('Mall 2'),
onTap: () {
setState(() {
currentMall = 'Mall 2';
});
Navigator.of(context).pop();
},
),
// Add more mall options here
],
),
),
);
},
);
},
child: Container(
width: 300,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.location_on),
SizedBox(width: 28),
Text(currentMall, style: TextStyle(fontSize: 20),),
SizedBox(width: 28),
Text(
'Change',
style: TextStyle(fontSize: 15),
),
],
),
),
style: ElevatedButton.styleFrom(
primary: Color(0xFFBD1F1F),
onPrimary: Colors.white,
),
),
SizedBox(height: 20,),
Stack(
alignment: Alignment.center,
children: [
Container(
height: 1.5,
width: double.infinity,
color: Color(0xFF900b0b),
),
Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Color(0xFF900b0b),
),
child: Padding(
padding: const EdgeInsets.all(23),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [IconButton(
icon: Icon(Icons.camera_alt),
onPressed: (){},
iconSize: 70,
color: Colors.white,
),
Text(
"Scan to Start",
style: TextStyle(color: Colors.white, fontSize: 20),
),
],
),
),
),
],
),
SizedBox(height: 25,),
ElevatedButton(onPressed: (){},
child: Container(
width: 350,
height: 100,
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 20),
decoration: BoxDecoration(
color: Color(0xFFBD1F1F),
borderRadius: BorderRadius.circular(10),
),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(height: 20,),
Icon(Icons.shopping_cart, color: Colors.white, ),
SizedBox(width: 10,),
Text(
'GO TO CART',
style: TextStyle(color: Colors.white, fontSize: 23),
)
],
),
SizedBox(height: 15,),
Text('pick where you left from',
style: TextStyle(color: Colors.white, fontSize: 18),)
],
),
),),
],
),
),
),
);
}
}