-
Notifications
You must be signed in to change notification settings - Fork 0
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
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
bedf296
M3-107 Refactor : code refact
tkdals802 7f7b563
M3-107 Feat : 마이페이지 걸음수, 픽셀 표시 창 UI구현, 오늘 걸음수 목표 그래프 UI구현
tkdals802 6e15766
M3-107 Refactor : code refact
tkdals802 0ec0dd0
M3-107 Feat : 마이페이지 걸음수, 픽셀 표시 창 UI구현, 오늘 걸음수 목표 그래프 UI구현
tkdals802 b449792
M3-154 Feat : 안드로이드 만보기 rebase
tkdals802 bd14d28
M3-154 Feat : 이미지 아이콘 추가
tkdals802 819f74a
M3-154 Feat : 현재 걸음수 마이페이지 연동
tkdals802 e6edaca
M3-154 Feat : 유저 픽셀 서비스, 모델 구현
tkdals802 f7b984f
M3-154 Refactor : userPixelLog 서비스, 컨트롤러, 모델 구현
tkdals802 4b064b9
M3-154 Refactor : flutter analyze 수정
tkdals802 1099df3
M3-154 Refactor : userPixelLog 서비스, 컨트롤러, 모델 구현
tkdals802 64dc00b
M3-154 Refactor : flutter analyze 수정
tkdals802 2a8cba9
M3-154 Feat : DisplayPixelStepCount 구현
tkdals802 ccd3a87
M3-154 Refactor : 클래스 이름, 구조 리팩토링
tkdals802 59c2c26
M3-154 Refactor : flutter 린트 수정, step graph 예외처리
tkdals802 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,40 @@ | ||
import 'package:get/get.dart'; | ||
|
||
import '../models/user.dart'; | ||
import '../models/user_pixel_count.dart'; | ||
import '../service/user_service.dart'; | ||
|
||
class MyPageController extends GetxController { | ||
final UserService userService = UserService(); | ||
final Rx<User> currentUserInfo = User().obs; | ||
final Rx<UserPixelCount> userPixelCount = UserPixelCount().obs; | ||
|
||
@override | ||
Future<void> onInit() async { | ||
super.onInit(); | ||
User userInfo = await userService.getCurrentUserInfo(); | ||
UserPixelCount userPixelLogInfo = await userService.getUserPixelCount(); | ||
currentUserInfo.value = userInfo; | ||
super.onInit(); | ||
userPixelCount.value = userPixelLogInfo; | ||
} | ||
|
||
getProfileImageURL() { | ||
return currentUserInfo.value.profileImageUrl; | ||
} | ||
|
||
getCurrentUserNickname() { | ||
return currentUserInfo.value.nickname; | ||
String getCurrentUserNickname() { | ||
return currentUserInfo.value.nickname ?? "-"; | ||
} | ||
|
||
getCurrentUserCommunityName() { | ||
String getCurrentUserCommunityName() { | ||
return currentUserInfo.value.communityName ?? "-"; | ||
} | ||
|
||
int getCurrentUserPixel(){ | ||
return userPixelCount.value.currentPixelCount ?? 0; | ||
} | ||
|
||
int getAccumulateUserPixel(){ | ||
return userPixelCount.value.accumulatePixelCount ?? 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class UserPixelCount { | ||
int? currentPixelCount; | ||
int? accumulatePixelCount; | ||
|
||
UserPixelCount({ | ||
this.currentPixelCount, | ||
this.accumulatePixelCount, | ||
}); | ||
|
||
UserPixelCount.fromJson(Map<String, dynamic> json){ | ||
currentPixelCount = json['currentPixelCount']; | ||
accumulatePixelCount = json['accumulatePixelCount']; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:get/get.dart'; | ||
|
||
import '../../controllers/my_page_controller.dart'; | ||
import '../../controllers/walking_controller.dart'; | ||
import 'dash_board_widget.dart'; | ||
|
||
class DashBoard extends StatelessWidget { | ||
DashBoard({ | ||
super.key, | ||
}); | ||
|
||
final MyPageController myPageController = Get.find<MyPageController>(); | ||
final WalkingController walkingController = Get.find<WalkingController>(); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Stack( | ||
alignment: Alignment.center, | ||
children: [ | ||
Container( | ||
padding: const EdgeInsets.all(10.0), | ||
height: 150, | ||
decoration: BoxDecoration( | ||
color: Color(0xFFD9D9D9), | ||
borderRadius: BorderRadius.circular(10), | ||
), | ||
), | ||
Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceEvenly, | ||
children: [ | ||
DashBoardWidget( | ||
textValue: "현재 픽셀수", | ||
iconImageUrl: "currentTile.png", | ||
countValue: myPageController.getCurrentUserPixel().obs,), | ||
DashBoardWidget( | ||
textValue: "누적 픽셀수", | ||
iconImageUrl: "allTile.png", | ||
countValue: myPageController.getAccumulateUserPixel().obs,), | ||
DashBoardWidget( | ||
textValue: "걸음수", | ||
iconImageUrl: "stepIcon.png", | ||
countValue: walkingController.currentStep, | ||
), | ||
], | ||
), | ||
], | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:get/get.dart'; | ||
|
||
import '../../controllers/my_page_controller.dart'; | ||
import '../../controllers/walking_controller.dart'; | ||
|
||
class DashBoardWidget extends StatelessWidget { | ||
final String textValue; | ||
final String iconImageUrl; | ||
final RxInt countValue; | ||
|
||
DashBoardWidget({ | ||
super.key, | ||
required this.textValue, | ||
required this.iconImageUrl, | ||
required this.countValue, | ||
}); | ||
|
||
final MyPageController myPageController = Get.find<MyPageController>(); | ||
final WalkingController walkingController = Get.find<WalkingController>(); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
width: 100, | ||
height: 140, | ||
decoration: BoxDecoration( | ||
color: Colors.white, | ||
borderRadius: BorderRadius.circular(10), | ||
), | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
Text(textValue), | ||
Image.asset( | ||
'assets/$iconImageUrl', | ||
width: 40, | ||
height: 40, | ||
), // () => Text('$countValue'), | ||
Obx(() =>Text('${countValue.value}')), | ||
], | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:get/get.dart'; | ||
|
||
import '../../controllers/walking_controller.dart'; | ||
|
||
class TodayGoalChart extends StatelessWidget { | ||
const TodayGoalChart({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
WalkingController walkingController = Get.put(WalkingController()); | ||
return Column( | ||
children: [ | ||
Stack( | ||
children: [ | ||
Container( | ||
padding: const EdgeInsets.all(10.0), | ||
height: 30, | ||
decoration: BoxDecoration( | ||
color: Colors.white, | ||
borderRadius: BorderRadius.all( | ||
Radius.circular(8), | ||
), | ||
), | ||
), | ||
Obx( | ||
() => Container( | ||
padding: const EdgeInsets.all(10.0), | ||
height: 30, | ||
width: walkingController.currentStep.value <= 10000 | ||
? (MediaQuery.of(context).size.width - 20) / | ||
10000 * | ||
walkingController.currentStep.value | ||
: 10000, | ||
decoration: BoxDecoration( | ||
color: Colors.greenAccent, | ||
borderRadius: BorderRadius.all( | ||
Radius.circular(8), | ||
), | ||
), | ||
), | ||
), | ||
], | ||
), | ||
Obx( | ||
() => Text( | ||
'목표 걸음의 ${(walkingController.currentStep.value / 10000 * 100).toStringAsFixed(2)} % 달성!!', | ||
), | ||
), | ||
], | ||
); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
단순히 공간을 띄우시려고 쓴거 같은데 Container 대신 SIzedBox 도 고려 해볼 수 있을 것 같아요!