Skip to content

Commit 958591c

Browse files
authored
feat: 온도 그래프 api연결 (#94)
* feat: 온도그래프 화면으로 전환 * feat: 온도그래프 화면으로 전환 * feat: 온도그래프 화면으로 전환 * feat: 온도그래프 화면으로 전환 * feat: 온도그래프 화면으로 전환 * feat: 온도그래프 화면 구현 * feat: 온도그래프 화면 구현 * feat: 온도그래프 화면 구현 * feat: 온도그래프 화면 구현 * feat: 온도그래프 화면 구현 * feat: 마이페이지 및 온도지수 api연결 * feat: 마이페이지 api 연결 * feat: 마이페이지 api 연결 * feat: 가족기여도 api 연결 * feat: dkdkkkkkk
1 parent 2fae858 commit 958591c

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,10 @@ class _HomeDegreeGraph extends State<HomeDegreeGraph> {
199199
sideTitles: SideTitles(
200200
showTitles: true,
201201
getTitlesWidget: (value, meta) {
202-
int idx = value.round();
203-
if (idx < 0 || idx >= dates.length) return const SizedBox.shrink();
202+
if (value % 1 != 0) return const SizedBox.shrink();
203+
int idx = value.toInt();
204+
if (idx < 0 || idx >= dates.length)
205+
return const SizedBox.shrink();
204206
return Padding(
205207
padding: const EdgeInsets.only(top: 8),
206208
child: Text(
@@ -276,12 +278,13 @@ class _HomeDegreeGraph extends State<HomeDegreeGraph> {
276278
SizedBox(
277279
height: 290,
278280
child: ListView.builder(
279-
itemCount: contributions.length,
281+
itemCount: history.length,
280282
itemBuilder: (context, idx) {
281-
final item = contributions[idx];
283+
final item = history[idx];
282284
return Row(
283285
crossAxisAlignment: CrossAxisAlignment.start,
284286
children: [
287+
// 왼쪽 선과 원
285288
Column(
286289
children: [
287290
Container(
@@ -293,14 +296,14 @@ class _HomeDegreeGraph extends State<HomeDegreeGraph> {
293296
color: Colors.white,
294297
),
295298
),
296-
if (idx != contributions.length - 1)
299+
if (idx != history.length - 1)
297300
Container(width: 2, height: 24, color: Colors.orange),
298301
],
299302
),
300303
const SizedBox(width: 8),
301304
Expanded(
302305
child: Text(
303-
"${item.userName}이 ${item.formattedChange} 상승 시켰어요!",
306+
"${item['name']}이 ${item['change']} 상승 시켰어요!",
304307
style: const TextStyle(
305308
color: Colors.grey,
306309
fontSize: 15,
@@ -309,7 +312,7 @@ class _HomeDegreeGraph extends State<HomeDegreeGraph> {
309312
),
310313
),
311314
Text(
312-
item.formattedDate,
315+
item['date'] ?? '',
313316
style: const TextStyle(
314317
color: Colors.grey,
315318
fontSize: 12,
@@ -325,4 +328,3 @@ class _HomeDegreeGraph extends State<HomeDegreeGraph> {
325328
);
326329
}
327330
}
328-

0 commit comments

Comments
 (0)