Skip to content

Commit 37be32f

Browse files
committed
홈화면
1 parent bb08921 commit 37be32f

21 files changed

+952
-94
lines changed

lib/Widget/home.dart

+140-94
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,25 @@ class Home extends StatefulWidget {
1515
}
1616

1717
class _HomeState extends State<Home> {
18+
1819
// List<Widget> list=[ ToDayWidget(), ToDayWidget()]; ************
1920

20-
static List<String> RestaurantName = [
21-
'sample1',
22-
'sample2',
23-
'sample3',
24-
];
21+
// static List<String> RestaurantName = [
22+
// 'sample1',
23+
// 'sample2',
24+
// 'sample3',
25+
// ];
2526

26-
static List<String> RestaurantImagePath = [
27-
'images/sample1.jpg',
28-
'images/sample2.jpg',
29-
'images/sample3.jpg',
30-
];
27+
// static List<String> RestaurantImagePath = [
28+
// 'images/sample1.jpg',
29+
// 'images/sample2.jpg',
30+
// 'images/sample3.jpg',
31+
// ];
3132

32-
final List<infinityRestaurant> RestaurantData = List.generate(
33-
RestaurantName.length,
34-
(index) => infinityRestaurant(
35-
RestaurantName[index], RestaurantImagePath[index]));
33+
// final List<infinityRestaurant> RestaurantData = List.generate(
34+
// RestaurantName.length,
35+
// (index) => infinityRestaurant(
36+
// RestaurantName[index], RestaurantImagePath[index]));
3637

3738
@override
3839
Widget build(BuildContext context) {
@@ -47,29 +48,34 @@ class _HomeState extends State<Home> {
4748
),
4849
drawerEdgeDragWidth: 20,
4950
drawerEnableOpenDragGesture: true,
50-
body: ListView.builder(
51-
itemCount: RestaurantData.length,
52-
itemBuilder: (context, index){
53-
return Card(
54-
child: ListTile(
55-
title: Text(
56-
RestaurantData[index].name
57-
),
58-
leading: SizedBox(
59-
height: 50, width: 50, child: Image.asset(RestaurantData[index].imgPath),
60-
),
61-
),
62-
);
63-
},
64-
),
51+
body: ListView(children: [
52+
ToDayWidget(),
53+
FavorateFood(),
54+
BestFood(),
55+
]),
56+
);
57+
}
58+
}
59+
6560

66-
// ListView(
67-
// children: [
68-
// // Row(children: list,), *************
69-
// ToDayWidget(),
70-
// // ToDayWidget(), ToDayWidget(), ToDayWidget(), ToDayWidget(), ToDayWidget(),
71-
// ],
72-
// ),
61+
62+
63+
class FoodWidget extends StatelessWidget {
64+
const FoodWidget({Key? key}) : super(key: key);
65+
66+
@override
67+
Widget build(BuildContext context) {
68+
return Container(
69+
child: Column(
70+
children: [
71+
Container(
72+
width: 150,
73+
height: 100,
74+
color: Colors.grey,
75+
),
76+
Text("음식 이름"),
77+
],
78+
),
7379
);
7480
}
7581
}
@@ -78,78 +84,118 @@ class ToDayWidget extends StatelessWidget {
7884
//const
7985
ToDayWidget({Key? key}) : super(key: key);
8086

81-
static List<String> RestaurantName = [
82-
'sample1',
83-
'sample2',
84-
'sample3',
85-
];
86-
87-
static List<String> RestaurantImagePath = [
88-
'images/sample1.jpg',
89-
'images/sample2.jpg',
90-
'images/sample3.jpg',
91-
];
92-
93-
final List<infinityRestaurant> RestaurantData = List.generate(
94-
RestaurantName.length,
95-
(index) => infinityRestaurant(
96-
RestaurantName[index], RestaurantImagePath[index]));
97-
9887
@override
9988
Widget build(BuildContext context) {
10089
return Padding(
10190
padding: const EdgeInsets.all(8.0),
10291
child: Column(
103-
// mainAxisAlignment: ,
104-
crossAxisAlignment: CrossAxisAlignment.start,
10592
children: [
93+
Text(
94+
"오늘 이거 어때요?",
95+
style: TextStyle(fontSize: 24),
96+
),
10697
Container(
107-
padding: const EdgeInsets.all(8.0),
108-
child: Center(child: Text("오늘 이건 어때요?")),
109-
width: double.infinity,
110-
decoration: BoxDecoration(
111-
color: Colors.grey[300],
112-
borderRadius: BorderRadius.all(Radius.circular(15.0)),
98+
height: 160,
99+
child: ListView(
100+
scrollDirection: Axis.horizontal,
101+
children: [
102+
Padding(
103+
padding: const EdgeInsets.all(16.0),
104+
child: FoodWidget(),
105+
),
106+
Padding(
107+
padding: const EdgeInsets.all(16.0),
108+
child: FoodWidget(),
109+
),
110+
Padding(
111+
padding: const EdgeInsets.all(16.0),
112+
child: FoodWidget(),
113+
),
114+
],
113115
),
116+
)
117+
],
118+
),
119+
);
120+
}
121+
}
122+
123+
class FavorateFood extends StatelessWidget {
124+
//const
125+
FavorateFood({Key? key}) : super(key: key);
126+
127+
@override
128+
Widget build(BuildContext context) {
129+
return Padding(
130+
padding: const EdgeInsets.all(8.0),
131+
child: Column(
132+
children: [
133+
Text(
134+
"남성이 좋아하는 음식",
135+
style: TextStyle(fontSize: 24),
114136
),
115137
Container(
116-
height: 1.0,
117-
width: 500,
118-
color: Colors.black,
119-
),
120-
SizedBox(
121-
height: 5,
122-
),
123-
SizedBox(
124-
child: Image.asset('assets/images/sample1.jpg'),
138+
height: 160,
139+
child: ListView(
140+
scrollDirection: Axis.horizontal,
141+
children: [
142+
Padding(
143+
padding: const EdgeInsets.all(16.0),
144+
child: FoodWidget(),
145+
),
146+
Padding(
147+
padding: const EdgeInsets.all(16.0),
148+
child: FoodWidget(),
149+
),
150+
Padding(
151+
padding: const EdgeInsets.all(16.0),
152+
child: FoodWidget(),
153+
),
154+
],
155+
),
156+
)
157+
],
158+
),
159+
);
160+
}
161+
}
162+
163+
class BestFood extends StatelessWidget {
164+
//const
165+
BestFood({Key? key}) : super(key: key);
166+
167+
@override
168+
Widget build(BuildContext context) {
169+
return Padding(
170+
padding: const EdgeInsets.all(8.0),
171+
child: Column(
172+
children: [
173+
Text(
174+
"최근 일주일 인기 음식점",
175+
style: TextStyle(fontSize: 24),
125176
),
126177
Container(
127-
child: Center(child: Text(" 갈비탕")),
128-
decoration: BoxDecoration(color: Colors.grey[300]),
129-
),
130-
Text("00이 선호하는 음식"),
131-
Text("최근 일주일 인기 음식점"),
132-
Text("최근 남겨진 리뷰"),
133-
// ListView.builder(
134-
// itemCount: RestaurantData.length,
135-
// itemBuilder: (context, index){
136-
// return Card(
137-
// child: ListTile(
138-
// title: Text(
139-
// RestaurantData[index].name
140-
// ),
141-
// leading: SizedBox(
142-
// height: 50, width: 50, child: Image.asset(RestaurantData[index].imgPath),
143-
// ),
144-
// ),
145-
// );
146-
// },
147-
// ),
148-
Text("음식점 이름"),
149-
Text("음식점 이름"),
178+
height: 160,
179+
child: ListView(
180+
scrollDirection: Axis.horizontal,
181+
children: [
182+
Padding(
183+
padding: const EdgeInsets.all(16.0),
184+
child: FoodWidget(),
185+
),
186+
Padding(
187+
padding: const EdgeInsets.all(16.0),
188+
child: FoodWidget(),
189+
),
190+
Padding(
191+
padding: const EdgeInsets.all(16.0),
192+
child: FoodWidget(),
193+
),
194+
],
195+
),
196+
)
150197
],
151198
),
152199
);
153200
}
154201
}
155-

restaurant.git/HEAD

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ref: refs/heads/main

restaurant.git/config

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[core]
2+
repositoryformatversion = 0
3+
filemode = true
4+
bare = true
5+
ignorecase = true
6+
precomposeunicode = true
7+
[remote "origin"]
8+
url = https://github.com/oyc0401/restaurant.git
9+
fetch = +refs/*:refs/*
10+
mirror = true
11+
pushurl = https://github.com/YumYum-INMAT/Flutter.git

restaurant.git/description

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Unnamed repository; edit this file 'description' to name the repository.
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
#
3+
# An example hook script to check the commit log message taken by
4+
# applypatch from an e-mail message.
5+
#
6+
# The hook should exit with non-zero status after issuing an
7+
# appropriate message if it wants to stop the commit. The hook is
8+
# allowed to edit the commit message file.
9+
#
10+
# To enable this hook, rename this file to "applypatch-msg".
11+
12+
. git-sh-setup
13+
commitmsg="$(git rev-parse --git-path hooks/commit-msg)"
14+
test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"}
15+
:
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/sh
2+
#
3+
# An example hook script to check the commit log message.
4+
# Called by "git commit" with one argument, the name of the file
5+
# that has the commit message. The hook should exit with non-zero
6+
# status after issuing an appropriate message if it wants to stop the
7+
# commit. The hook is allowed to edit the commit message file.
8+
#
9+
# To enable this hook, rename this file to "commit-msg".
10+
11+
# Uncomment the below to add a Signed-off-by line to the message.
12+
# Doing this in a hook is a bad idea in general, but the prepare-commit-msg
13+
# hook is more suited to it.
14+
#
15+
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
16+
# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
17+
18+
# This example catches duplicate Signed-off-by lines.
19+
20+
test "" = "$(grep '^Signed-off-by: ' "$1" |
21+
sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
22+
echo >&2 Duplicate Signed-off-by lines.
23+
exit 1
24+
}

0 commit comments

Comments
 (0)