Skip to content

Commit 50a429c

Browse files
taekoongNeibce
andauthored
fix: 타가족 랭킹 아이콘 추가 및 등수 겹침 오류 해결 (#168)
* feat: 타가족 걸음수 랭킹 화면 * feat: 타가족 걸음수 랭킹 화면 연결 * feat: 타가족 걸음수 랭킹 화면 연결 * feat: 타가족 걸음수 랭킹 화면 연결 * feat: 도넛 차트 api 연결 * feat: 서비스 파일 pr * feat: 운동 스트레칭 화면 구현 * fix: 스트레칭 관련 오류 수정 * feat: 운동 스트레칭 화면 구현 * fix: 마음 기록 추가 수정 * fix: 걸음수 랭킹 등수 크기 수정 * fix: 걸음수 랭킹 등수 아이콘 추가 --------- Co-authored-by: Junyoung Yang <y@jun0.dev>
1 parent 4f2b1a9 commit 50a429c

File tree

8 files changed

+104
-49
lines changed

8 files changed

+104
-49
lines changed
Lines changed: 3 additions & 0 deletions
Loading

frontend/ongi/lib/screens/health/cross_family_ranking_screen.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,9 @@ Widget _buildRankingMember({
290290
children: [
291291
// 메인 컨테이너
292292
Transform.translate(
293-
offset: Offset(isCurrentUser ? 20 : 40, 0),
293+
offset: Offset(isCurrentUser ? 30 : 52, 0),
294294
child: Container(
295-
width: MediaQuery.of(context).size.width * 0.7,
295+
width: MediaQuery.of(context).size.width * 0.65,
296296
decoration: BoxDecoration(
297297
color: isCurrentUser ? AppColors.ongiOrange : Colors.white,
298298
borderRadius: BorderRadius.circular(20),
@@ -362,8 +362,8 @@ Widget _buildRankingMember({
362362
// 우리 가족 순위
363363
if (isCurrentUser)
364364
Positioned(
365-
left: -25,
366-
top: -25,
365+
left: -35,
366+
top: -40,
367367
child: Container(
368368
child: Center(
369369
child: Text(

frontend/ongi/lib/screens/health/health_home_screen.dart

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,15 +1114,27 @@ class _HealthHomeScreenState extends State<HealthHomeScreen> {
11141114
color: Colors.white,
11151115
borderRadius: BorderRadius.circular(16),
11161116
),
1117-
child: const Text(
1118-
'다른 가족들은 얼마나 걸었을까요?',
1119-
style: TextStyle(
1120-
fontSize: 10,
1121-
fontWeight: FontWeight.w400,
1122-
color: Colors.black,
1123-
height: 1.2,
1124-
),
1125-
textAlign: TextAlign.right,
1117+
child: Row(
1118+
mainAxisSize: MainAxisSize.min,
1119+
children: [
1120+
SvgPicture.asset(
1121+
'assets/images/step_ranking_icon.svg',
1122+
height: 10,
1123+
width: 10,
1124+
color: AppColors.ongiGrey,
1125+
),
1126+
const SizedBox(width: 4),
1127+
const Text(
1128+
'다른 가족들은 얼마나 걸었을까요?',
1129+
style: TextStyle(
1130+
fontSize: 10,
1131+
fontWeight: FontWeight.w400,
1132+
color: Colors.black,
1133+
height: 1.2,
1134+
),
1135+
textAlign: TextAlign.right,
1136+
),
1137+
],
11261138
),
11271139
),
11281140
),

frontend/ongi/lib/screens/health/health_status_input_screen.dart

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,6 @@ class _HealthStatusInputScreenState extends State<HealthStatusInputScreen> {
414414
'오른쪽 발': 'https://youtu.be/8g0cwnIxn44?si=7Qy8mQWH0RgTz9T9',
415415
};
416416
}
417-
418-
// 통증 부위에 맞는 스트레칭 링크들을 가져오는 함수
419417
List<Map<String, String>> getStretchingLinksForPainAreas() {
420418
final stretchingLinks = getStretchingLinks();
421419
final painAreaLinks = <Map<String, String>>[];
@@ -427,9 +425,8 @@ class _HealthStatusInputScreenState extends State<HealthStatusInputScreen> {
427425
List<String> areas = [];
428426

429427
if (painArea is List) {
430-
areas = painArea
431-
.map((area) => _convertPainAreaToKorean(area.toString()))
432-
.toList();
428+
areas = painArea.map((area) => _convertPainAreaToKorean(area.toString())).toList();
429+
433430
} else {
434431
areas = [_convertPainAreaToKorean(painArea.toString())];
435432
}
@@ -445,6 +442,7 @@ class _HealthStatusInputScreenState extends State<HealthStatusInputScreen> {
445442
}
446443

447444
if (!addedLinks.contains(link)) {
445+
448446
painAreaLinks.add({'name': displayName, 'url': link});
449447
addedLinks.add(link);
450448
}
@@ -610,7 +608,10 @@ class _HealthStatusInputScreenState extends State<HealthStatusInputScreen> {
610608
child: Row(
611609
mainAxisAlignment: MainAxisAlignment.center,
612610
children: [
613-
Icon(Icons.play_circle_outline, size: 20),
611+
Icon(
612+
Icons.play_circle_outline,
613+
size: 20,
614+
),
614615
const SizedBox(width: 8),
615616
Text(
616617
'${linkInfo['name']} 스트레칭',
@@ -629,7 +630,6 @@ class _HealthStatusInputScreenState extends State<HealthStatusInputScreen> {
629630
),
630631
)
631632
else
632-
// 스트레칭 링크가 없을 때의 기본 버튼
633633
SizedBox(
634634
width: double.infinity,
635635
height: 50,
@@ -1058,6 +1058,7 @@ class _HealthStatusInputScreenState extends State<HealthStatusInputScreen> {
10581058
Widget _buildStretchingButton() {
10591059
return Visibility(
10601060
visible: _isStretchingVisible, // _isStretchingVisible 값에 따라 버튼 표시 여부 결정
1061+
),
10611062
child: Padding(
10621063
padding: const EdgeInsets.all(25),
10631064
child: Column(
@@ -1094,6 +1095,7 @@ class _HealthStatusInputScreenState extends State<HealthStatusInputScreen> {
10941095
minimumSize: const Size(double.infinity, 35),
10951096
shape: RoundedRectangleBorder(
10961097
borderRadius: BorderRadius.circular(20),
1098+
10971099
),
10981100
padding: const EdgeInsets.symmetric(vertical: 8),
10991101
),
@@ -1454,6 +1456,7 @@ class _HealthStatusInputScreenState extends State<HealthStatusInputScreen> {
14541456
color: Colors.black.withValues(
14551457
alpha: 0.1,
14561458
),
1459+
14571460
blurRadius: 4,
14581461
offset: const Offset(0, 2),
14591462
),
@@ -1497,4 +1500,4 @@ class _HealthStatusInputScreenState extends State<HealthStatusInputScreen> {
14971500
),
14981501
);
14991502
}
1500-
}
1503+
}

frontend/ongi/lib/screens/photo/detail_record_screen.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ class _DetailRecordScreenState extends State<DetailRecordScreen> {
310310
final userInfo = snapshot.data ?? {};
311311
final profileImageId = userInfo['profileImageId'] ?? 0;
312312
final profileImagePath = PrefsManager.getProfileImagePath(profileImageId);
313-
313+
314314
return CircleAvatar(
315315
radius: 22,
316316
backgroundImage: AssetImage(profileImagePath),
@@ -384,7 +384,7 @@ class _DetailRecordScreenState extends State<DetailRecordScreen> {
384384
.toList();
385385
final comment = _commentController.text.trim();
386386
final accessToken =
387-
await PrefsManager.getAccessToken();
387+
await PrefsManager.getAccessToken();
388388

389389
if (accessToken == null) {
390390
throw Exception('로그인이 필요합니다. 다시 로그인해주세요.');
@@ -407,13 +407,13 @@ class _DetailRecordScreenState extends State<DetailRecordScreen> {
407407
);
408408

409409
final frontFileName =
410-
presignedData['frontFileName'] as String;
410+
presignedData['frontFileName'] as String;
411411
final frontPresignedUrl =
412-
presignedData['frontPresignedUrl'] as String;
412+
presignedData['frontPresignedUrl'] as String;
413413
final backFileName =
414-
presignedData['backFileName'] as String;
414+
presignedData['backFileName'] as String;
415415
final backPresignedUrl =
416-
presignedData['backPresignedUrl'] as String;
416+
presignedData['backPresignedUrl'] as String;
417417

418418
await service.uploadFileToS3(
419419
presignedUrl: backPresignedUrl,
@@ -422,7 +422,7 @@ class _DetailRecordScreenState extends State<DetailRecordScreen> {
422422
);
423423

424424
final actualFrontFileName =
425-
widget.frontImagePath != null
425+
widget.frontImagePath != null
426426
? frontFileName
427427
: backFileName;
428428
if (widget.frontImagePath != null) {
@@ -458,7 +458,7 @@ class _DetailRecordScreenState extends State<DetailRecordScreen> {
458458
ScaffoldMessenger.of(context).showSnackBar(
459459
SnackBar(
460460
content: Text(
461-
'업로드 실패: $e',
461+
'업로드 실패, $e',
462462
style: const TextStyle(
463463
color: AppColors.ongiOrange,
464464
),
@@ -491,4 +491,4 @@ class _DetailRecordScreenState extends State<DetailRecordScreen> {
491491
),
492492
);
493493
}
494-
}
494+
}

frontend/ongi/lib/screens/photo/photo_date_screen.dart

Lines changed: 48 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -320,28 +320,58 @@ class _PhotoDateScreenState extends State<PhotoDateScreen> {
320320
mainAxisSize: MainAxisSize.min,
321321
children: [
322322
Row(
323+
crossAxisAlignment: CrossAxisAlignment.start,
323324
children: [
324-
FutureBuilder<String>(
325-
future: PrefsManager.getProfileImagePathByUserName(
326-
maumLog.uploader,
327-
_familyMembers,
328-
),
329-
builder: (context, snapshot) {
330-
final profileImagePath =
331-
snapshot.data ??
332-
PrefsManager.getProfileImagePath(0);
333-
return Image.asset(profileImagePath, width: 30);
334-
},
325+
Column(
326+
crossAxisAlignment: CrossAxisAlignment.start,
327+
children: [
328+
FutureBuilder<String>(
329+
future: PrefsManager.getProfileImagePathByUserName(
330+
maumLog.uploader,
331+
_familyMembers,
332+
),
333+
builder: (context, snapshot) {
334+
final profileImagePath =
335+
snapshot.data ??
336+
PrefsManager.getProfileImagePath(0);
337+
return Image.asset(profileImagePath, width: 30);
338+
},
339+
),
340+
const SizedBox(height: 8),
341+
// 사용자 이름
342+
Container(
343+
padding: const EdgeInsets.symmetric(
344+
horizontal: 8,
345+
vertical: 2,
346+
),
347+
decoration: BoxDecoration(
348+
color: Colors.white,
349+
borderRadius: BorderRadius.circular(20),
350+
),
351+
child: Text(
352+
maumLog.uploader,
353+
style: TextStyle(
354+
color: AppColors.ongiOrange,
355+
fontSize: 5.5,
356+
fontWeight: FontWeight.w400,
357+
fontFamily: 'Pretendard',
358+
),
359+
),
360+
),
361+
],
335362
),
336363
const SizedBox(width: 8),
337364
Expanded(
338-
child: Text(
339-
maumLog.comment,
340-
style: const TextStyle(
341-
color: Colors.white,
342-
fontSize: 10,
343-
fontFamily: 'Pretendard',
344-
fontWeight: FontWeight.w500,
365+
child: Padding(
366+
padding: const EdgeInsets.only(top: 20),
367+
child: Text(
368+
maumLog.comment,
369+
style: const TextStyle(
370+
color: Colors.white,
371+
fontSize: 10,
372+
fontFamily: 'Pretendard',
373+
fontWeight: FontWeight.w500,
374+
),
345375
),
346376
),
347377
),

frontend/ongi/lib/services/maum_log_service.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@ class MaumLogService {
2020
);
2121

2222
if (response.statusCode == 200 || response.statusCode == 201) {
23-
return MaumLogResponse.fromJson(jsonDecode(response.body));
23+
final responseBody = jsonDecode(response.body);
24+
25+
if (responseBody is Map<String, dynamic>) {
26+
return MaumLogResponse.fromJson(responseBody);
27+
} else {
28+
throw Exception('API 응답이 예상한 형태가 아닙니다: ${responseBody.runtimeType}');
29+
}
2430
} else {
2531
throw Exception('마음 기록을 불러오는 데에 실패했습니다. 상태 코드: ${response.statusCode}');
2632
}

frontend/ongi/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ flutter:
9191
- assets/images/location_icon.svg
9292
- assets/images/record_tooltip.svg
9393
- assets/images/cross_family_ranking_title_logo.png
94+
- assets/images/step_ranking_icon.svg
9495
fonts:
9596
- family: Pretendard
9697
fonts:

0 commit comments

Comments
 (0)