Skip to content

Commit de63121

Browse files
authored
feat: 서비스 업로드 (#98)
1 parent cab0d8d commit de63121

File tree

3 files changed

+81
-83
lines changed

3 files changed

+81
-83
lines changed

frontend/ongi/lib/screens/home/home_degree_graph.dart

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class _HomeDegreeGraph extends State<HomeDegreeGraph> {
4848
List<FlSpot> get spots {
4949
return List.generate(
5050
dailyTemperatures.length,
51-
(i) => FlSpot(i.toDouble(), dailyTemperatures[i]['totalTemperature'] ?? 36.5),
51+
(i) => FlSpot(i.toDouble(), dailyTemperatures[i]['totalTemperature'] ?? 36.5),
5252
);
5353
}
5454

@@ -138,10 +138,10 @@ class _HomeDegreeGraph extends State<HomeDegreeGraph> {
138138
child: isLoading
139139
? const Center(child: CircularProgressIndicator())
140140
: errorMsg != null
141-
? Center(child: Text(errorMsg!))
142-
: showHistory
143-
? _buildHistoryList()
144-
: _buildGraphCard(),
141+
? Center(child: Text(errorMsg!))
142+
: showHistory
143+
? _buildHistoryList()
144+
: _buildGraphCard(),
145145
),
146146
),
147147
],
@@ -279,9 +279,9 @@ class _HomeDegreeGraph extends State<HomeDegreeGraph> {
279279
SizedBox(
280280
height: 290,
281281
child: ListView.builder(
282-
itemCount: history.length,
282+
itemCount: contributions.length,
283283
itemBuilder: (context, idx) {
284-
final item = history[idx];
284+
final item = contributions[idx];
285285
return Row(
286286
crossAxisAlignment: CrossAxisAlignment.start,
287287
children: [
@@ -297,14 +297,14 @@ class _HomeDegreeGraph extends State<HomeDegreeGraph> {
297297
color: Colors.white,
298298
),
299299
),
300-
if (idx != history.length - 1)
300+
if (idx != contributions.length - 1)
301301
Container(width: 2, height: 24, color: Colors.orange),
302302
],
303303
),
304304
const SizedBox(width: 8),
305305
Expanded(
306306
child: Text(
307-
"${item['name']}이 ${item['change']} 상승 시켰어요!",
307+
"${item.userName}이 ${item.formattedChange} 상승 시켰어요!",
308308
style: const TextStyle(
309309
color: Colors.grey,
310310
fontSize: 15,
@@ -314,7 +314,6 @@ class _HomeDegreeGraph extends State<HomeDegreeGraph> {
314314
),
315315
Text(
316316
item.formattedDate ?? '',
317-
318317
style: const TextStyle(
319318
color: Colors.grey,
320319
fontSize: 12,

frontend/ongi/lib/screens/home/home_donutCapsule.dart

Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class _HomeCapsuleSectionState extends State<HomeCapsuleSection> {
3737
final today = DateTime.now();
3838
final todayStr = '${today.year.toString().padLeft(4, '0')}-${today.month.toString().padLeft(2, '0')}-${today.day.toString().padLeft(2, '0')}';
3939
final match = dailyTemps.firstWhere(
40-
(e) => e['date'] == todayStr,
40+
(e) => e['date'] == todayStr,
4141
orElse: () => <String, dynamic>{},
4242
);
4343
setState(() {
@@ -57,84 +57,84 @@ class _HomeCapsuleSectionState extends State<HomeCapsuleSection> {
5757
return Expanded(
5858
child: Stack(
5959
children: [
60-
// 도넛 차트 영역
61-
Positioned(
62-
left: 0,
63-
bottom: MediaQuery.of(context).size.height * 0.05,
64-
width: MediaQuery.of(context).size.width * 0.95,
65-
height: MediaQuery.of(context).size.width * 0.95,
66-
child: Stack(
67-
clipBehavior: Clip.none,
68-
children: [
69-
Align(
70-
alignment: Alignment.centerLeft,
71-
child: GestureDetector(
72-
onTap: widget.onGraphTap,
73-
child: Transform.translate(
74-
offset: Offset(
75-
-MediaQuery.of(context).size.width * 0.35,
76-
0,
77-
),
78-
child: OverflowBox(
79-
maxWidth: double.infinity,
80-
maxHeight: double.infinity,
81-
child: CustomPaint(
82-
painter: CustomChartPainter(
83-
percentages: [15, 10, 20, 20],
60+
// 도넛 차트 영역
61+
Positioned(
62+
left: 0,
63+
bottom: MediaQuery.of(context).size.height * 0.05,
64+
width: MediaQuery.of(context).size.width * 0.95,
65+
height: MediaQuery.of(context).size.width * 0.95,
66+
child: Stack(
67+
clipBehavior: Clip.none,
68+
children: [
69+
Align(
70+
alignment: Alignment.centerLeft,
71+
child: GestureDetector(
72+
onTap: widget.onGraphTap,
73+
child: Transform.translate(
74+
offset: Offset(
75+
-MediaQuery.of(context).size.width * 0.35,
76+
0,
8477
),
85-
size: Size(
86-
MediaQuery.of(context).size.width * 0.95,
87-
MediaQuery.of(context).size.width * 0.95,
78+
child: OverflowBox(
79+
maxWidth: double.infinity,
80+
maxHeight: double.infinity,
81+
child: CustomPaint(
82+
painter: CustomChartPainter(
83+
percentages: [15, 10, 20, 20],
84+
),
85+
size: Size(
86+
MediaQuery.of(context).size.width * 0.95,
87+
MediaQuery.of(context).size.width * 0.95,
88+
),
89+
),
8890
),
8991
),
9092
),
9193
),
92-
),
93-
),
94-
// 텍스트 (화면 안에 있음)
95-
Positioned(
96-
left:
97-
MediaQuery.of(context).size.width *
98-
0.04,
99-
top: 0,
100-
bottom: 0,
101-
child: Center(
102-
child: isLoading
103-
? const CircularProgressIndicator()
104-
: Row(
105-
crossAxisAlignment: CrossAxisAlignment.end,
106-
children: [
107-
Text(
108-
todayTemperature?.toStringAsFixed(1) ?? '36.5',
109-
style: TextStyle(
110-
fontSize: 43,
111-
fontWeight: FontWeight.w800,
112-
color: AppColors.ongiOrange,
113-
height: 1,
114-
),
94+
// 텍스트 (화면 안에 있음)
95+
Positioned(
96+
left:
97+
MediaQuery.of(context).size.width *
98+
0.04,
99+
top: 0,
100+
bottom: 0,
101+
child: Center(
102+
child: isLoading
103+
? const CircularProgressIndicator()
104+
: Row(
105+
crossAxisAlignment: CrossAxisAlignment.end,
106+
children: [
107+
Text(
108+
todayTemperature?.toStringAsFixed(1) ?? '36.5',
109+
style: TextStyle(
110+
fontSize: 43,
111+
fontWeight: FontWeight.w800,
112+
color: AppColors.ongiOrange,
113+
height: 1,
115114
),
116-
Text(
117-
'℃',
118-
style: TextStyle(
119-
fontSize: 24,
120-
fontWeight: FontWeight.w800,
121-
color: AppColors.ongiOrange,
122-
),
115+
),
116+
Text(
117+
'℃',
118+
style: TextStyle(
119+
fontSize: 24,
120+
fontWeight: FontWeight.w800,
121+
color: AppColors.ongiOrange,
123122
),
124-
],
125-
),
126-
),
123+
),
124+
],
125+
),
126+
),
127+
),
128+
],
127129
),
128-
],
129-
),
130-
),
131-
Positioned(
132-
right: 0,
133-
bottom: MediaQuery.of(context).size.height * 0.05,
134-
child: ButtonColumn(),
135-
),
136-
],
137-
),
130+
),
131+
Positioned(
132+
right: 0,
133+
bottom: MediaQuery.of(context).size.height * 0.05,
134+
child: ButtonColumn(),
135+
),
136+
],
137+
),
138138
);
139139
}
140140
}

frontend/ongi/lib/services/temperature_service.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class TemperatureService {
1818
final data = json.decode(response.body);
1919
return List<Map<String, dynamic>>.from(data['dailyTemperatures'] ?? []);
2020
} else {
21-
throw Exception('가족 온도 일별 데이터 불러오기 실패');
21+
throw Exception('가족 온도 일별 데이터 불러오기 실패 ${response.statusCode}');
2222
}
2323
}
2424

@@ -34,7 +34,6 @@ class TemperatureService {
3434
if (response.statusCode == 200) {
3535
final data = json.decode(response.body);
3636
return data['contributions'] ?? [];
37-
3837
} else {
3938
throw Exception('가족 온도 기여도 데이터 불러오기 실패');
4039
}

0 commit comments

Comments
 (0)