-
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-181 로그아웃 및 토큰 리프레시 구현 #26
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
48e625d
M3-181 Feat : 마이페이지 앱바에 설정 버튼 추가
koomin1227 e30e69d
M3-181 Feat : 설정 페이지 구현
koomin1227 72264f3
M3-181 Style : 공백 추가
koomin1227 56a2f1f
M3-181 Feat : 로그아웃 버튼을 누르면 로그아웃 시키는 기능 구현
koomin1227 ab80288
M3-181 Feat : 로그아웃 버튼을 눌렀을때 로그아웃 할 건지 물어보는 모달 창 생성
koomin1227 db25e7a
M3-181 Feat : 로그아웃 시 서버에 로그아웃 요청 전송
koomin1227 87edd4a
M3-181 Feat : 기본 이미지 변경
koomin1227 0e31ecf
M3-181 Feat : defaultUserId 변경
koomin1227 0a0c608
M3-181 Feat : model 이름 변경
koomin1227 9ad2a16
M3-181 Feat : 토큰 재발급 구현
koomin1227 b5176a9
M3-181 Feat : 토큰 재발급 구현 완료
koomin1227 65cc8e5
M3-181 Style : 콤마 추가
koomin1227 d978ff0
M3-181 Style : 빈 파일 삭제
koomin1227 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
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,36 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:get/get.dart'; | ||
|
||
import '../service/auth_service.dart'; | ||
|
||
class SettingController extends GetxController { | ||
final AuthService authService = AuthService(); | ||
|
||
logout() async { | ||
_showLogoutDialog(); | ||
} | ||
|
||
void _showLogoutDialog() { | ||
Get.dialog( | ||
AlertDialog( | ||
title: Text('로그아웃 하시겠습니까?'), | ||
actions: [ | ||
TextButton( | ||
child: Text('아니오'), | ||
onPressed: () async { | ||
await authService.logout(); | ||
Get.back(); | ||
}, | ||
), | ||
TextButton( | ||
child: Text('예'), | ||
onPressed: () async { | ||
await authService.logout(); | ||
Get.offAllNamed('/login'); | ||
}, | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
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,14 @@ | ||
class ReissueResponse { | ||
String? accessToken; | ||
String? refreshToken; | ||
|
||
ReissueResponse({ | ||
this.accessToken, | ||
this.refreshToken, | ||
}); | ||
|
||
ReissueResponse.fromJson(Map<String, dynamic> json) { | ||
accessToken = json['accessToken']; | ||
refreshToken = json['refreshToken']; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,57 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:get/get.dart'; | ||
|
||
import '../controllers/setting_controller.dart'; | ||
import '../widgets/setting/setting_item.dart'; | ||
import '../widgets/setting/setting_section.dart'; | ||
|
||
class SettingScreen extends StatelessWidget { | ||
const SettingScreen({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
SettingController settingController = Get.put(SettingController()); | ||
|
||
return Scaffold( | ||
appBar: AppBar( | ||
backgroundColor: Theme.of(context).colorScheme.inversePrimary, | ||
title: const Text('설정'), | ||
), | ||
body: ListView( | ||
children: [ | ||
SettingsSection( | ||
title: '설정', | ||
items: [ | ||
SettingsItem(title: '수령 정보 설정'), | ||
SettingsItem(title: '알림 설정'), | ||
SettingsItem(title: '맵 설정'), | ||
SettingsItem(title: '실험실'), | ||
SettingsItem(title: '앱 최적화'), | ||
SettingsItem(title: 'App Store 리뷰 남기기'), | ||
], | ||
), | ||
SettingsSection( | ||
title: '가이드', | ||
items: [ | ||
SettingsItem(title: '공지사항'), | ||
SettingsItem(title: '플레이 가이드'), | ||
SettingsItem(title: '고객 문의 및 개선 요청'), | ||
], | ||
), | ||
SettingsSection( | ||
title: '기타', | ||
items: [ | ||
SettingsItem(title: '서비스이용약관'), | ||
SettingsItem( | ||
title: '로그아웃', | ||
onTap: () { | ||
settingController.logout(); | ||
}, | ||
), | ||
], | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
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,20 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class SettingsItem extends StatelessWidget { | ||
final String title; | ||
final VoidCallback? onTap; | ||
|
||
const SettingsItem({required this.title, this.onTap, super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ListTile( | ||
title: Text( | ||
title, | ||
style: const TextStyle(color: Colors.black), | ||
), | ||
trailing: const Icon(Icons.arrow_forward_ios, color: Colors.black), | ||
onTap: onTap, | ||
); | ||
} | ||
} |
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.
해당 부분 하나의 콜백이 너무 길어지는 느낌이 드는데, 한번 더 크게 묶어서 handleAuthorization() 같은 이름의 메소드로 묶는 건 어떨까요?