-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from SWM-M3PRO/feature/M3-181-logoutAndRefresh
M3-181 로그아웃 및 토큰 리프레시 구현
- Loading branch information
Showing
16 changed files
with
248 additions
and
30 deletions.
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.