diff --git a/lib/views/Main_page.dart b/lib/views/Main_page.dart index bae9e3a..a420f17 100644 --- a/lib/views/Main_page.dart +++ b/lib/views/Main_page.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:suwon/views/widgets/cancel_and_action_alert_dialog.dart'; import 'package:suwon/views/edit_profie.dart'; import 'package:suwon/views/login_screen.dart'; import 'package:suwon/views/matching_loding.dart'; @@ -70,156 +71,134 @@ class MainPage extends StatelessWidget { ], ), endDrawer: Drawer( - backgroundColor: Colors.white, - width: 250.sp, - child: Container( - height: 800.sp, - width: double.infinity, - child: - ListView( - physics: const NeverScrollableScrollPhysics(), - padding: EdgeInsets.only(top: 0), - children: [ - Column( - children: [ - Container( - height: 85.sp, - child: Row( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - SizedBox( - width: 190.sp, - ), - IconButton( - onPressed: () {}, - icon: Image.asset( - 'asstes/close.png', - scale: 4.sp, + backgroundColor: Colors.white, + width: 250.sp, + child: Container( + height: 800.sp, + width: double.infinity, + child: ListView( + physics: const NeverScrollableScrollPhysics(), + padding: EdgeInsets.only(top: 0), + children: [ + Column( + children: [ + Container( + height: 85.sp, + child: Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + SizedBox( + width: 190.sp, ), - ) - ], - ), - ), - UserAccountsDrawerHeader( - decoration: BoxDecoration(color: Colors.white), - margin: EdgeInsets.zero, - currentAccountPicture: CircleAvatar( - backgroundColor: Colors.white, - backgroundImage: AssetImage('asstes/Group.png'), - ), - currentAccountPictureSize: Size(49.sp, 49.sp), - accountName: Text( - 'AnSungMin', - style: TextStyle( - color: Colors.black, - fontFamily: 'KCCChassam', - fontSize: 22.sp, - fontStyle: FontStyle.normal, - fontWeight: FontWeight.w400, + IconButton( + onPressed: () {}, + icon: Image.asset( + 'asstes/close.png', + scale: 4.sp, + ), + ) + ], ), ), - accountEmail: Text( - '# ISTP', - style: TextStyle( - color: Color(0xff767676), - fontFamily: 'KCCChassam', - fontSize: 14.sp, - fontStyle: FontStyle.normal, - fontWeight: FontWeight.w400, + UserAccountsDrawerHeader( + decoration: BoxDecoration(color: Colors.white), + margin: EdgeInsets.zero, + currentAccountPicture: CircleAvatar( + backgroundColor: Colors.white, + backgroundImage: AssetImage('asstes/Group.png'), ), - ), - ), - Container( - height: 400.sp, - width: double.infinity, - decoration: BoxDecoration( - border: Border( - top: BorderSide( - color: Color(0xffEDEDED), - width: 1.sp, + currentAccountPictureSize: Size(49.sp, 49.sp), + accountName: Text( + 'AnSungMin', + style: TextStyle( + color: Colors.black, + fontFamily: 'KCCChassam', + fontSize: 22.sp, + fontStyle: FontStyle.normal, + fontWeight: FontWeight.w400, ), - bottom: BorderSide( - color: Color(0xffEDEDED), - width: 1.sp, + ), + accountEmail: Text( + '# ISTP', + style: TextStyle( + color: Color(0xff767676), + fontFamily: 'KCCChassam', + fontSize: 14.sp, + fontStyle: FontStyle.normal, + fontWeight: FontWeight.w400, ), ), ), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - SizedBox( - height: 59.sp, - ), - ListTile( - leading: SvgPicture.asset('asstes/profile.svg'), - title: Text( - '프로필 수정', - style: TextStyle( - color: Colors.black, - fontFamily: 'Pretendard', - fontSize: 16.sp, - fontStyle: FontStyle.normal, - fontWeight: FontWeight.w400, - letterSpacing: -0.4.sp, - ), + Container( + height: 400.sp, + width: double.infinity, + decoration: BoxDecoration( + border: Border( + top: BorderSide( + color: Color(0xffEDEDED), + width: 1.sp, ), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => EditProfile(), - ), - ); - }, - trailing: Image.asset( - 'asstes/Vector6.png', - scale: 4.sp, + bottom: BorderSide( + color: Color(0xffEDEDED), + width: 1.sp, ), ), - ListTile( - leading: SvgPicture.asset('asstes/policy.svg'), - title: Text( - '이용약관', - style: TextStyle( - color: Colors.black, - fontFamily: 'Pretendard', - fontSize: 16.sp, - fontStyle: FontStyle.normal, - fontWeight: FontWeight.w400, - letterSpacing: -0.4.sp, - ), - ), - onTap: () {}, - trailing: Image.asset( - 'asstes/Vector6.png', - scale: 4.sp, + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + SizedBox( + height: 59.sp, ), - ), - ListTile( - leading: SvgPicture.asset('asstes/feedback.svg'), - title: Text( - '피드백', - style: TextStyle( - color: Colors.black, - fontFamily: 'Pretendard', - fontSize: 16.sp, - fontStyle: FontStyle.normal, - fontWeight: FontWeight.w400, - letterSpacing: -0.4.sp, + ListTile( + leading: SvgPicture.asset('asstes/profile.svg'), + title: Text( + '프로필 수정', + style: TextStyle( + color: Colors.black, + fontFamily: 'Pretendard', + fontSize: 16.sp, + fontStyle: FontStyle.normal, + fontWeight: FontWeight.w400, + letterSpacing: -0.4.sp, + ), + ), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => EditProfile(), + ), + ); + }, + trailing: Image.asset( + 'asstes/Vector6.png', + scale: 4.sp, ), ), - onTap: () {}, - trailing: Image.asset( - 'asstes/Vector6.png', - scale: 4.sp, + ListTile( + leading: SvgPicture.asset('asstes/policy.svg'), + title: Text( + '이용약관', + style: TextStyle( + color: Colors.black, + fontFamily: 'Pretendard', + fontSize: 16.sp, + fontStyle: FontStyle.normal, + fontWeight: FontWeight.w400, + letterSpacing: -0.4.sp, + ), + ), + onTap: () {}, + trailing: Image.asset( + 'asstes/Vector6.png', + scale: 4.sp, + ), ), - ), - ListTile( - leading: SvgPicture.asset('asstes/logout.svg'), - title: Padding( - padding: EdgeInsets.zero, - child: Text( - '로그아웃', + ListTile( + leading: SvgPicture.asset('asstes/feedback.svg'), + title: Text( + '피드백', style: TextStyle( color: Colors.black, fontFamily: 'Pretendard', @@ -229,89 +208,117 @@ class MainPage extends StatelessWidget { letterSpacing: -0.4.sp, ), ), + onTap: () {}, + trailing: Image.asset( + 'asstes/Vector6.png', + scale: 4.sp, + ), ), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => NewLoignMain()), - ); - }, - trailing: Image.asset( - 'asstes/Vector6.png', - scale: 4.sp, + ListTile( + leading: SvgPicture.asset('asstes/logout.svg'), + title: Padding( + padding: EdgeInsets.zero, + child: Text( + '로그아웃', + style: TextStyle( + color: Colors.black, + fontFamily: 'Pretendard', + fontSize: 16.sp, + fontStyle: FontStyle.normal, + fontWeight: FontWeight.w400, + letterSpacing: -0.4.sp, + ), + ), + ), + onTap: () { + CancelAndActionAlertDialog( + title: "로그아웃 하시겠습니까?", + action: "로그아웃", + onAction: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + NewLoignMain()), + ); + }, + onCancel: () {}) + .show(context); + }, + trailing: Image.asset( + 'asstes/Vector6.png', + scale: 4.sp, + ), ), - ), - SizedBox( - height: 100.sp, - ) - ], + SizedBox( + height: 100.sp, + ) + ], + ), ), - ), - Container( - height: 150.sp, - width: double.infinity, - color: Color(0xffEDEDED), - child: Row( - children: [ - SizedBox( - width: 32.sp, - ), - Column( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 15.sp, - ), - Image.asset( - 'asstes/SUCHAT.png', - scale: 3.sp, - ), - SizedBox( - height: 12.sp, - ), - Text( - 'Copyright 2023.\nFlag inc. all rights reserved.', - style: TextStyle( - color: Color(0xff767676), - fontFamily: 'Pretendard', - fontSize: 10.sp, - fontStyle: FontStyle.normal, - fontWeight: FontWeight.w400, - letterSpacing: 0.25.sp, + Container( + height: 150.sp, + width: double.infinity, + color: Color(0xffEDEDED), + child: Row( + children: [ + SizedBox( + width: 32.sp, + ), + Column( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 15.sp, ), - ), - TextButton( - onPressed: () {}, - child: Text( - '회원 탈퇴하기 >', + Image.asset( + 'asstes/SUCHAT.png', + scale: 3.sp, + ), + SizedBox( + height: 12.sp, + ), + Text( + 'Copyright 2023.\nFlag inc. all rights reserved.', style: TextStyle( color: Color(0xff767676), fontFamily: 'Pretendard', - fontSize: 12.sp, + fontSize: 10.sp, fontStyle: FontStyle.normal, fontWeight: FontWeight.w400, - letterSpacing: 0.3.sp, + letterSpacing: 0.25.sp, ), ), - style: TextButton.styleFrom( - padding: EdgeInsets.zero), - ) - ], - ) - ], - ) - ], - ), - ) - ], - ) - ], - ), - ) - ), + TextButton( + onPressed: () {}, + child: Text( + '회원 탈퇴하기 >', + style: TextStyle( + color: Color(0xff767676), + fontFamily: 'Pretendard', + fontSize: 12.sp, + fontStyle: FontStyle.normal, + fontWeight: FontWeight.w400, + letterSpacing: 0.3.sp, + ), + ), + style: TextButton.styleFrom( + padding: EdgeInsets.zero), + ) + ], + ) + ], + ) + ], + ), + ) + ], + ) + ], + ), + )), body: Container( color: Colors.white, child: Column( @@ -343,7 +350,11 @@ class MainPage extends StatelessWidget { scale: 1.sp, child: Transform.translate( offset: const Offset(25, -60), - child: Image.asset('asstes/bubble_main.PNG', scale: 1.sp,fit: BoxFit.fill,), + child: Image.asset( + 'asstes/bubble_main.PNG', + scale: 1.sp, + fit: BoxFit.fill, + ), ), ), ), @@ -364,7 +375,6 @@ class MainPage extends StatelessWidget { width: double.infinity, ), Container( - child: Text( '주의!! 욕설 및 상대방에게 불쾌함을 주는 채팅\n 적발 시 계정 이용이 제한됩니다 ', style: TextStyle( @@ -385,14 +395,14 @@ class MainPage extends StatelessWidget { height: 20.sp, width: double.infinity, child: Text( - '@copyright by Flag',textAlign: TextAlign.center, + '@copyright by Flag', + textAlign: TextAlign.center, style: TextStyle( color: Color(0xff767676), fontFamily: 'Pretendard', fontSize: 12.sp, fontWeight: FontWeight.w400, letterSpacing: 0.3.sp, - ), ), ) diff --git a/lib/views/signup_done.dart b/lib/views/signup_done.dart index cbbe84f..4820a06 100644 --- a/lib/views/signup_done.dart +++ b/lib/views/signup_done.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:suwon/views/widgets/normal_alert_dialog.dart'; import 'package:suwon/views/widgets/csbutton.dart'; import 'package:suwon/views/login_screen.dart'; @@ -109,7 +110,16 @@ class _SignUpDoneState extends State { CustomButton( text: '메일 재발송', backgroundColor: Color(0xFF111111), - onPressed: () {}, + onPressed: () { + NormalAlertDialog( + title: "알림", + message: "포털 메일이 재발송되었습니다.", + onClose: () { + // 다이얼로그 닫기 후 뒤로 화면이동 + //Navigator.of(context).pop(); + }, + ).show(context); + }, color: Colors.white, ), ], diff --git a/lib/views/widgets/cancel_and_action_alert_dialog.dart b/lib/views/widgets/cancel_and_action_alert_dialog.dart new file mode 100644 index 0000000..6188789 --- /dev/null +++ b/lib/views/widgets/cancel_and_action_alert_dialog.dart @@ -0,0 +1,41 @@ +import 'package:flutter/cupertino.dart'; + +class CancelAndActionAlertDialog { + final String title; + final String action; + final VoidCallback onCancel; + final VoidCallback onAction; + + CancelAndActionAlertDialog({ + required this.title, + required this.action, + required this.onCancel, + required this.onAction, + }); + + void show(BuildContext context) { + showCupertinoDialog( + context: context, + builder: (BuildContext context) { + return CupertinoAlertDialog( + title: Text(title), + actions: [ + CupertinoDialogAction( + child: Text('취소'), + onPressed: () { + onCancel(); + Navigator.of(context).pop(); + }, + ), + CupertinoDialogAction( + child: Text(action), + onPressed: () { + onAction(); + }, + ), + ], + ); + }, + ); + } +} diff --git a/lib/views/widgets/normal_alert_dialog.dart b/lib/views/widgets/normal_alert_dialog.dart new file mode 100644 index 0000000..0280c60 --- /dev/null +++ b/lib/views/widgets/normal_alert_dialog.dart @@ -0,0 +1,34 @@ +import 'package:flutter/cupertino.dart'; + +class NormalAlertDialog { + final String title; + final String message; + final VoidCallback onClose; + + NormalAlertDialog({ + required this.title, + required this.message, + required this.onClose, + }); + + void show(BuildContext context) { + showCupertinoDialog( + context: context, + builder: (BuildContext context) { + return CupertinoAlertDialog( + title: Text(title), + content: Text(message), + actions: [ + CupertinoDialogAction( + child: Text('확인'), + onPressed: () { + onClose(); + Navigator.of(context).pop(); + }, + ), + ], + ); + }, + ); + } +}