-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'GDSC-DGU:develop' into develop
- Loading branch information
Showing
4 changed files
with
38 additions
and
35 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 |
---|---|---|
@@ -1,39 +1,19 @@ | ||
import 'package:firebase_auth/firebase_auth.dart'; | ||
import 'package:earlips/services/auth/auth_service.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:get/get.dart'; | ||
|
||
Future<void> showLogoutDialog(BuildContext context) async { | ||
return showDialog<void>( | ||
context: context, | ||
barrierDismissible: false, | ||
builder: (BuildContext context) { | ||
return AlertDialog( | ||
title: const Text('로그아웃'), | ||
content: const SingleChildScrollView( | ||
child: ListBody( | ||
children: <Widget>[ | ||
Text('정말 로그아웃하시겠습니까?'), | ||
], | ||
), | ||
), | ||
actions: <Widget>[ | ||
TextButton( | ||
child: const Text('취소'), | ||
onPressed: () { | ||
Get.back(); | ||
}, | ||
), | ||
TextButton( | ||
child: const Text('로그아웃'), | ||
onPressed: () async { | ||
// 로그아웃 처리 | ||
// FirebaseAuth.instance.signOut(); | ||
await FirebaseAuth.instance.signOut(); | ||
Get.back(); | ||
}, | ||
), | ||
], | ||
); | ||
final AuthService authService = AuthService(); | ||
|
||
return Get.defaultDialog( | ||
title: '로그아웃', | ||
content: const Text('정말 로그아웃하시겠습니까?'), | ||
textConfirm: '로그아웃', | ||
textCancel: '취소', | ||
onCancel: () => Get.back(), // Equivalent to closing the dialog | ||
onConfirm: () async { | ||
await authService.signOut(); | ||
Get.back(); // Close the dialog after signOut | ||
}, | ||
); | ||
} |
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