-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome_screen_orignal.txt
166 lines (157 loc) · 4.82 KB
/
home_screen_orignal.txt
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
//import 'dart:html';
import 'package:Hunarmand_signIn_Ui/Widgets/header_widget.dart';
import 'package:Hunarmand_signIn_Ui/utils/color.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
class Home extends StatefulWidget {
Home({Key key}) : super(key: key);
@override
_HomeState createState() => _HomeState();
}
class _HomeState extends State<Home> {
@override
Widget build(BuildContext context) {
return Scaffold(
// backgroundColor: Color(0xFF81F2836),
body: Container(
width: double.infinity,
margin: EdgeInsets.only(left: 70),
//color: Colors.red,
child: Column(
//mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
//,
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Padding(
padding: EdgeInsets.only(left: 30, top: 10),
child: Row(
children: [
_slider(
color: Colors.grey,
title: 'Electrican',
subtitle: 'Highely trained'),
_slider(
color: Colors.blueGrey,
title: 'Plumber',
subtitle: 'Highely trained')
],
),
),
),
Container(
padding: EdgeInsets.only(bottom: 20.0, left: 10.0),
alignment: Alignment.topLeft,
child: Text(
'Pupolar services',
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 20.0,
letterSpacing: 0.5,
),
),
),
Expanded(
child: GridView.count(
mainAxisSpacing: 2,
crossAxisSpacing: 2,
primary: false,
crossAxisCount: 3,
children: <Widget>[
_cardWidget(
image: 'assets/electrician.JPG', text: 'Electrician'),
_cardWidget(image: 'assets/plumber12.JPG', text: 'Plumber'),
_cardWidget(image: 'assets/carpenter.JPG', text: 'Carpenter'),
_cardWidget(image: 'assets/carpenter.JPG', text: 'Masson'),
_cardWidget(image: 'assets/gardner.JPG', text: 'Gardner'),
_cardWidget(image: 'assets/painter.JPG', text: 'Painter'),
_cardWidget(
image: 'assets/carpenter.JPG', text: 'Electrician'),
_cardWidget(
image: 'assets/carpenter.JPG', text: 'Electrician'),
],
),
),
],
),
),
);
}
Widget _slider(
{@required Color color,
@required String title,
@required String subtitle}) {
return Container(
margin: EdgeInsets.only(top: 5.0, left: 10.0, right: 10.0, bottom: 15.0),
padding: EdgeInsets.only(left: 10.0),
height: 120,
width: 240,
decoration: BoxDecoration(
color: color,
borderRadius: BorderRadius.circular(15.0),
image: DecorationImage(
image: AssetImage('assets/electric_bg.jpg'),
fit: BoxFit.fill,
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.only(top: 50.0),
child: Text(
title,
style: TextStyle(
fontSize: 22.0,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
),
SizedBox(
height: 5.0,
),
Text(
subtitle,
style: TextStyle(
color: Colors.amber,
fontSize: 19.0,
),
)
],
),
);
}
Widget _cardWidget({String image, String text}) {
return Card(
color: Colors.white,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
elevation: 10.0,
shadowColor: Colors.blueGrey,
margin: EdgeInsets.all(5.0),
//shadowColor: Color(0xffF5591F),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Image(
image: AssetImage(
image,
),
height: 70.0,
width: 150.0,
),
SizedBox(
height: 10.0,
),
Text(text,
style: TextStyle(
color: Colors.black,
fontSize: 15.0,
))
],
),
);
}
}