Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
jwson-automation committed Jul 22, 2024
1 parent fff7074 commit f93fd57
Showing 1 changed file with 157 additions and 160 deletions.
317 changes: 157 additions & 160 deletions lib/screens/mypage/MyPageScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,186 +27,183 @@ class MyPageScreen extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
final profileImage = ref.watch(profileImageStreamProvider);

return Padding(
padding: const EdgeInsets.all(8.0),
child: Scaffold(
appBar: AppBar(
title: const Text(AppStrings.myPageTitle),
),
body: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
profileImageStack(profileImage, ref, context),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
NickNameTextWidget(),
Text("Google 로그인을 사용 중 입니다.")
],
),
)
],
),
const SizedBox(
height: 40,
),
const CustomDividerWidget(),
GestureDetector(
onTap: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => const FixSettingAccountManager(),
));
},
child: const ListTile(
leading: Icon(Icons.person),
title: Text(
"관리",
style: TextStyle(fontSize: 20),
return Scaffold(
appBar: AppBar(
title: const Text(AppStrings.myPageTitle),
),
body: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
profileImageStack(profileImage, ref, context),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
NickNameTextWidget(),
Text("Google 로그인을 사용 중 입니다.")
],
),
)
],
),
const SizedBox(
height: 40,
),
const CustomDividerWidget(),
GestureDetector(
onTap: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => const FixSettingAccountManager(),
));
},
child: const ListTile(
leading: Icon(Icons.person),
title: Text(
"관리",
style: TextStyle(fontSize: 20),
),
),
const CustomDividerWidget(),
GestureDetector(
onTap: () {},
child: const ListTile(
leading: Icon(Icons.card_membership),
title: Text(
"결제 정보",
style: TextStyle(fontSize: 20),
),
),
const CustomDividerWidget(),
GestureDetector(
onTap: () {},
child: const ListTile(
leading: Icon(Icons.card_membership),
title: Text(
"결제 정보",
style: TextStyle(fontSize: 20),
),
),
const CustomDividerWidget(),
GestureDetector(
onTap: () {},
child: const ListTile(
leading: Icon(Icons.alarm_add_outlined),
title: Text(
"알림",
style: TextStyle(fontSize: 20),
),
),
const CustomDividerWidget(),
GestureDetector(
onTap: () {},
child: const ListTile(
leading: Icon(Icons.alarm_add_outlined),
title: Text(
"알림",
style: TextStyle(fontSize: 20),
),
),
const CustomDividerWidget(),
GestureDetector(
onTap: () {},
child: const ListTile(
leading: Icon(Icons.lock),
title: Text(
"개인 / 보안",
style: TextStyle(fontSize: 20),
),
),
const CustomDividerWidget(),
GestureDetector(
onTap: () {},
child: const ListTile(
leading: Icon(Icons.lock),
title: Text(
"개인 / 보안",
style: TextStyle(fontSize: 20),
),
),
const CustomDividerWidget(),
GestureDetector(
onTap: () {},
child: const ListTile(
leading: Icon(Icons.monitor),
title: Text(
"테마",
style: TextStyle(fontSize: 20),
),
),
const CustomDividerWidget(),
GestureDetector(
onTap: () {},
child: const ListTile(
leading: Icon(Icons.monitor),
title: Text(
"테마",
style: TextStyle(fontSize: 20),
),
),
const CustomDividerWidget(),
GestureDetector(
onTap: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => const FixSettingCameraMediaPage(),
));
},
child: const ListTile(
leading: Icon(Icons.chat_bubble_outline),
title: Text(
"채팅 / 미디어",
style: TextStyle(fontSize: 20),
),
),
const CustomDividerWidget(),
GestureDetector(
onTap: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => const FixSettingCameraMediaPage(),
));
},
child: const ListTile(
leading: Icon(Icons.chat_bubble_outline),
title: Text(
"채팅 / 미디어",
style: TextStyle(fontSize: 20),
),
),
const SizedBox(
height: 30,
),
const CustomDividerWidget(),
GestureDetector(
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (context) {
return const SettingScreen();
}));
},
child: const ListTile(
leading: Icon(Icons.notifications),
title: Text(
"설정",
style: TextStyle(fontSize: 20),
),
),
const SizedBox(
height: 30,
),
const CustomDividerWidget(),
GestureDetector(
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (context) {
return const SettingScreen();
}));
},
child: const ListTile(
leading: Icon(Icons.notifications),
title: Text(
"설정",
style: TextStyle(fontSize: 20),
),
),
const CustomDividerWidget(),
),
const CustomDividerWidget(),

//Logout button
GestureDetector(
onTap: () {
ref.read(firebaseAuthServiceProvider).signOut();
},
child: const ListTile(
leading: Icon(Icons.logout),
title: Text(
"로그아웃",
style: TextStyle(fontSize: 20),
),
//Logout button
GestureDetector(
onTap: () {
ref.read(firebaseAuthServiceProvider).signOut();
},
child: const ListTile(
leading: Icon(Icons.logout),
title: Text(
"로그아웃",
style: TextStyle(fontSize: 20),
),
),
),

//Logout button
GestureDetector(
onTap: () async {
try {
final re = await engine.deleteAccount();
debugPrint(re.toString());
if (context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('회원탈퇴가 완료되었습니다.'),
),
);
}
ref.read(firebaseAuthServiceProvider).signOut();
} on FirebaseFunctionsException catch (e) {
if (context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text('Error: ${e.code}/${e.message}'),
),
);
}
} catch (e) {
if (context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
'Error: $e'), // e.code: internal, e.message: INTERNAL
),
);
}
//Logout button
GestureDetector(
onTap: () async {
try {
final re = await engine.deleteAccount();
debugPrint(re.toString());
if (context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('회원탈퇴가 완료되었습니다.'),
),
);
}
},
child: const Expanded(
child: ListTile(
leading: Icon(Icons.person_off),
title: Text(
"회원탈퇴",
style: TextStyle(fontSize: 20),
),
)),
),
],
),
ref.read(firebaseAuthServiceProvider).signOut();
} on FirebaseFunctionsException catch (e) {
if (context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text('Error: ${e.code}/${e.message}'),
),
);
}
} catch (e) {
if (context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
'Error: $e'), // e.code: internal, e.message: INTERNAL
),
);
}
}
},
child: const Expanded(
child: ListTile(
leading: Icon(Icons.person_off),
title: Text(
"회원탈퇴",
style: TextStyle(fontSize: 20),
),
)),
),
],
),
),
);
Expand Down

0 comments on commit f93fd57

Please sign in to comment.