Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M3-154 마이페이지 걸음수 Ui만들기 #22

Merged
merged 15 commits into from
Jul 9, 2024

Conversation

tkdals802
Copy link
Contributor

@tkdals802 tkdals802 commented Jul 9, 2024

작업 내용*

  • 마이페이지 걸음수, 픽셀수 표시창 구현
  • 마이페이지 현재 걸음수가 목표 걸음수의 몇%인지 보여주는 그래프 구현

고민한 내용*

  • 그래프의 전체 길이 = 화면 폭(width)-20
  • walking controller에서 현재 걸음수 받아오기
  • pixel service로 db에서 현재 픽셀수, 누적 픽셀수 받아오기

리뷰 요구사항

  • 함수, 변수 이름

스크린샷

|

image

@tkdals802 tkdals802 changed the title Feature/m3 154 mypage step UI M3-154 mypage step UI Jul 9, 2024
@koomin1227 koomin1227 force-pushed the feature/M3-154-mypageStepUI branch from c9c4a7b to 64dc00b Compare July 9, 2024 04:24
@tkdals802 tkdals802 changed the title M3-154 mypage step UI M3-154 마이페이지 걸음수 Ui만들기 Jul 9, 2024

Future<UserPixelLog> getUserPixelLog() async {
var response = await dio.get(
'/count',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

api url "/count" 맞나요?? api 명세서 상에는 "/api/pixels/count"로 되어있습니다!

@@ -0,0 +1,14 @@
class UserPixelLog {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pixel 들의 카운드를 담는 모델인데 UserPixelCount 는 어떨까요?

@@ -17,8 +19,14 @@ class MyPageScreen extends StatelessWidget {
child: Column(
children: [
UserInfo(),
const Text('마이페이지'),
Obx(() => Text(walkController.getCurrentStep())),
Container(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

단순히 공간을 띄우시려고 쓴거 같은데 Container 대신 SIzedBox 도 고려 해볼 수 있을 것 같아요!

@@ -18,4 +19,12 @@ class UserService {
var response = await dio.get('/users/$userId');
return User.fromJson(response.data['data']);
}

Future<UserPixelLog> getUserPixelLog() async {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

마찬가지로 getUserPixelCount 가 어떨까요?

@@ -46,10 +46,10 @@ class UserInfo extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
myPageController.getCurrentUserNickname(),
'그룹명',// myPageController.getCurrentUserNickname(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 왜 고정값으로 바뀌었나요?
컨트롤러에서 값을 가져오는 것으로 다시 수정하셔야 마이페이지에서 내 정보가 나올거 같네요~

style: TextStyle(fontSize: 25),
),
Text(myPageController.getCurrentUserCommunityName(),
Text('닉네임',//myPageController.getCurrentUserCommunityName(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

위랑 똑같습니다

Comment on lines 29 to 56
Container(
width: 120,
height: 130,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('현재 픽셀수'),
Image.asset(
'assets/currentTile.png',
width: 80,
height: 80,
),
Obx(
() => Text(
myPageController.getCurrentUserPixel().toString(),
),
),
],
),
),
Container(
width: 120,
height: 130,
decoration: BoxDecoration(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

보니까 비슷한 형식이 반복되는 것 같습니다.

Container(
               width: 120,
               height: 130,
               decoration: BoxDecoration(
                 color: Colors.white,
                 borderRadius: BorderRadius.circular(10),
               ),
               child: Column(
                 mainAxisAlignment: MainAxisAlignment.center,
                 children: [
                   Text('현재 픽셀수'),
                   Image.asset(
                     'assets/currentTile.png',
                     width: 80,
                     height: 80,
                   ),
                   Obx(
                     () => Text(
                       myPageController.getCurrentUserPixel().toString(),
                     ),
                   ),
                 ],
               ),
             ),

이부분을 공통 위젯으로 분리하고 생성할때 다른 이미지와 값을 받게하면 코드 중복을 개선할 수 있을 것 같아요

import '../../controllers/my_page_controller.dart';
import '../../controllers/walking_controller.dart';

class StepWindow extends StatelessWidget {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StepWindow 라는 이름을 잘 모르겠습니다.

현재 픽셀수, 누적 픽셀수, 현재 걸음수 에 대한 정보를 나타내는 이름이 더 좋지 않을까요?

지금은 Step 만 강조되어있는 것 같아요

@tkdals802 tkdals802 force-pushed the feature/M3-154-mypageStepUI branch from 64dc00b to ccd3a87 Compare July 9, 2024 08:31
Copy link
Member

@koomin1227 koomin1227 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

리뷰가 잘 반영된것 같습니다~

@tkdals802 tkdals802 merged commit fd2acf6 into develop Jul 9, 2024
1 check passed
@tkdals802 tkdals802 deleted the feature/M3-154-mypageStepUI branch July 9, 2024 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants