diff --git a/lib/views/CustomDrawerScreen.dart b/lib/views/CustomDrawerScreen.dart new file mode 100644 index 0000000..dc51878 --- /dev/null +++ b/lib/views/CustomDrawerScreen.dart @@ -0,0 +1,189 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:suwon/views/EditProfileDrawerScreen.dart'; +import 'package:suwon/views/TermsConditionsDrawerScreen.dart'; +import 'package:suwon/views/FeedbackDrawerScreen.dart'; +import 'package:suwon/views/login_screen.dart'; +import 'package:suwon/views/widgets/CancelAndActionAlertDialogWidget.dart'; + +class CustomDrawerScreen extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Drawer( + child: Container( + color: Colors.white, + child: ListView( + physics: const NeverScrollableScrollPhysics(), + padding: EdgeInsets.zero, + children: [ + Container( + height: 100.sp, + padding: EdgeInsets.only(right: 20.sp), + child: Row( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, // 가로 방향에서 맨 오른쪽 정렬 + children: [ + SizedBox(), + IconButton( + onPressed: () { + Navigator.of(context).pop(); + }, + icon: Image.asset( + 'asstes/close.png', + scale: 4.sp, + ), + ) + ], + ), + ), + Container( + padding: EdgeInsets.all(0), + child: Column( + children: [ + Container( + alignment: Alignment.topLeft, + margin: EdgeInsets.zero, // 상단 여백 제거 + padding: EdgeInsets.only(left: 40.sp), + height: 120, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + CircleAvatar( + backgroundColor: Colors.white, + backgroundImage: AssetImage('asstes/Group.png'), + ), + SizedBox(height: 8), + Text( + 'AnSungMin', + style: TextStyle( + color: Colors.black, + fontFamily: 'KCCChassam', + fontSize: 22, + fontStyle: FontStyle.normal, + fontWeight: FontWeight.w400, + ), + ), + Text( + '# ISTP', + style: TextStyle( + color: Color(0xff767676), + fontFamily: 'KCCChassam', + fontSize: 14, + fontStyle: FontStyle.normal, + fontWeight: FontWeight.w400, + ), + ), + ], + ), + ), + ], + ), + ), + Divider( + color: Color(0xFFEDEDED), + thickness: 1.0, + ), + SizedBox(height: 20), + ListTile_main( + text: '프로필 수정', + Menu_Icon: 'asstes/profile.svg', + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => EditProfileDrawerScreen(), + ), + ); + }, + ), + SizedBox(height: 20), + ListTile_main( + text: '이용약관', + Menu_Icon: 'asstes/policy.svg', + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => TermsConditionsDrawerScreen(), + ), + ); + }, + ), + SizedBox(height: 20), + ListTile_main( + text: ' 피드백', + Menu_Icon: 'asstes/feedback.svg', + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => FeedbackDrawerScreen(), + ), + ); + }, + ), + SizedBox(height: 20), + ListTile_main( + text: '로그아웃', + Menu_Icon: 'asstes/logout.svg', + onTap: () { + CancelAndActionAlertDialogWidget( + title: "로그아웃 하시겠습니까?", + action: "로그아웃", + onAction: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => NewLoignMain()), + ); + }, + onCancel: () {}) + .show(context); + }), + ], + ), + ), + ); + } +} + +class ListTile_main extends StatelessWidget { + final String text; + final String Menu_Icon; + final VoidCallback onTap; + + const ListTile_main( + {required this.text, required this.Menu_Icon, required this.onTap}); + @override + Widget build(BuildContext context) { + return ListTile( + title: Row( + children: [ + SizedBox( + width: 20.sp, + ), + SvgPicture.asset(Menu_Icon), + SizedBox(width: 10.sp), + Text( + text, + style: TextStyle( + color: Colors.black, + fontFamily: 'Pretendard', + fontSize: 16.sp, + fontStyle: FontStyle.normal, + fontWeight: FontWeight.w400, + letterSpacing: -0.4.sp, + ), + ), // 제목 + SizedBox(width: 20.sp), + Image.asset( + 'asstes/Vector6.png', + scale: 4.sp, + ) + ], + ), + onTap: onTap); + } +} diff --git a/lib/views/Main_page.dart b/lib/views/Main_page.dart index 9918f75..8d82fd1 100644 --- a/lib/views/Main_page.dart +++ b/lib/views/Main_page.dart @@ -1,11 +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/EditProfileDrawerScreen.dart'; -import 'package:suwon/views/TermsConditionsDrawerScreen.dart'; -import 'package:suwon/views/FeedbackDrawerScreen.dart'; -import 'package:suwon/views/login_screen.dart'; +import 'package:suwon/views/CustomDrawerScreen.dart'; import 'package:suwon/views/matching_loding.dart'; class MainPage extends StatelessWidget { @@ -18,298 +14,146 @@ class MainPage extends StatelessWidget { return ScreenUtilInit( designSize: Size(390, 844), builder: (context, child) => Scaffold( - backgroundColor: Colors.white, - key: _scaffoldKey, - resizeToAvoidBottomInset: false, - appBar: AppBar( - toolbarHeight: 80.h, - centerTitle: false, - automaticallyImplyLeading: false, - elevation: 0.0, - backgroundColor: Colors.white, - title: - Container( - width: 96.w, - height: 80.h, - padding: EdgeInsets.zero, - margin: EdgeInsets.zero, - child: Row( - children: [ - SizedBox(width: 15.w,), - Image.asset('asstes/SUCHAT.png', width: 76.w, height: 20.h, ) - ], - ), - ), - actions: [ - Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - child: IconButton( - onPressed: (){ - _scaffoldKey.currentState?.openEndDrawer(); - }, - icon: SvgPicture.asset('asstes/onclikmenu.svg', width: 28.w, - height: 20.h),) - ), - SizedBox(width: 25.w,), - ], - ), - ), - ], - ), - endDrawer: - Container( - child: - Drawer( + backgroundColor: Colors.white, + key: _scaffoldKey, + resizeToAvoidBottomInset: false, + appBar: AppBar( + toolbarHeight: 80.h, + centerTitle: false, + automaticallyImplyLeading: false, + elevation: 0.0, backgroundColor: Colors.white, - width: 240.w, - child: Container( - width: 240.w, - child: - ListView( - physics: const NeverScrollableScrollPhysics(), + title: Container( + width: 96.w, + height: 80.h, + padding: EdgeInsets.zero, + margin: EdgeInsets.zero, + child: Row( children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - DrawerHeader( - margin: EdgeInsets.zero, - child: Container( - height: 291.h, - child: Column( - children: [ - - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - IconButton(onPressed: (){}, icon: Image.asset('asstes/close.png', height: 16.h, width: 16.h,)) - ], - ) - ], - ), - ) - ), - - Container( - height: 402.h, - width: double.infinity, - decoration: BoxDecoration( - border: Border( - top: BorderSide( - color: Color(0xffEDEDED), - width: 1.w), - bottom: BorderSide( - color: Color(0xffEDEDED), - width: 1.w, - ), - ), - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Container( - height: 397.h, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - ListTile_main( - text: '프로필 수정', - Menu_Icon: 'asstes/profile.svg', - onTap: () - { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - EditProfileDrawerScreen(), - ), - ); - }, ), - ListTile_main( - text: '이용약관', - Menu_Icon: 'asstes/policy.svg', - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - TermsConditionsDrawerScreen(), - ), - ); - }, - ), - ListTile_main( - text: '피드백', - Menu_Icon: 'asstes/feedback.svg', - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - FeedbackDrawerScreen(), - ), - ); - }, - ), - ListTile_main( - text: '로그아웃', - Menu_Icon: 'asstes/logout.svg', onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => NewLoignMain()), - ); - } - ), - ], - ), - ), - ], - ), - ), - Container( - height: 150.h, - width: double.infinity, - color: Color(0xffEDEDED), - child: Row( - children: [ - SizedBox( - width: 32.w, - ), - Column( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 15.h, - ), - Image.asset( - 'asstes/SUCHAT.png', - scale: 3, - ), - SizedBox( - height: 12.h, - ), - 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, - ), - ), - resign_Button(), - ], - ) - ], - ) - ], - ), - ) - ], + SizedBox( + width: 15.w, + ), + Image.asset( + 'asstes/SUCHAT.png', + width: 76.w, + height: 20.h, ) ], ), - ) - ), - ), - body: Column( - children: [ - Container( - child: Text( - '_배너', - style: TextStyle( - fontSize: 18.sp, - fontWeight: FontWeight.w400, - ), ), - alignment: Alignment.center, - height: 55.h, - width: 390.w, - color: Color(0xffDBDBDB), + actions: [ + Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + child: IconButton( + onPressed: () { + _scaffoldKey.currentState?.openEndDrawer(); + }, + icon: SvgPicture.asset('asstes/onclikmenu.svg', + width: 28.w, height: 20.h), + )), + SizedBox( + width: 25.w, + ), + ], + ), + ), + ], ), - Row( + body: Column( children: [ - SizedBox(width: 32.w,), Container( - height: 335.h, - width: 358.w, - clipBehavior: Clip.hardEdge, - decoration: BoxDecoration(color: Colors.white), - child: Transform.scale( - scale: 1, - child: Transform.translate( - offset: const Offset(0, -60), - child: ClipRect( - child: Image.asset( - 'asstes/bubble_main.PNG', - fit: BoxFit.fill, + child: Text( + '_배너', + style: TextStyle( + fontSize: 18.sp, + fontWeight: FontWeight.w400, + ), + ), + alignment: Alignment.center, + height: 55.h, + width: 390.w, + color: Color(0xffDBDBDB), + ), + Row( + children: [ + SizedBox( + width: 32.w, + ), + Container( + height: 335.h, + width: 358.w, + clipBehavior: Clip.hardEdge, + decoration: BoxDecoration(color: Colors.white), + child: Transform.scale( + scale: 1, + child: Transform.translate( + offset: const Offset(0, -60), + child: ClipRect( + child: Image.asset( + 'asstes/bubble_main.PNG', + fit: BoxFit.fill, + ), + ), ), ), ), + ], + ), + Container( + child: CustomButton_main( + text: '매칭 시작하기', + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => MatchingLoading()), + ); + }, ), ), - ], - ), - Container( - child: CustomButton_main( - text: '매칭 시작하기', - onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => MatchingLoading() + SizedBox( + height: 24.h, + width: 360.w, + ), + Container( + child: Text( + '주의!! 욕설 및 상대방에게 불쾌함을 주는 채팅\n 적발 시 계정 이용이 제한됩니다 ', + style: TextStyle( + color: Color(0xff767676), + fontFamily: 'KCCChassam', + fontStyle: FontStyle.normal, + fontWeight: FontWeight.w400, + fontSize: 14.sp, + letterSpacing: -0.4, ), - ); - }, - ), - ), - SizedBox( - height: 24.h, - width: 360.w, - ), - Container( - child: Text( - '주의!! 욕설 및 상대방에게 불쾌함을 주는 채팅\n 적발 시 계정 이용이 제한됩니다 ', - style: TextStyle( - color: Color(0xff767676), - fontFamily: 'KCCChassam', - fontStyle: FontStyle.normal, - fontWeight: FontWeight.w400, - fontSize: 14.sp, - letterSpacing: -0.4, + ), ), - ), - ), - SizedBox( - height: 120.h, - width: 390.w, - ), - Container( - height: 20.h, - width: 390.w, - child: Text( - '@copyright by Flag', - textAlign: TextAlign.center, - style: TextStyle( - color: Color(0xff767676), - fontFamily: 'Pretendard', - fontSize: 12.sp, - fontWeight: FontWeight.w400, - letterSpacing: 0.3, + SizedBox( + height: 120.h, + width: 390.w, ), - ), - ) - ], - ), - ) - ); + Container( + height: 20.h, + width: 390.w, + child: Text( + '@copyright by Flag', + textAlign: TextAlign.center, + style: TextStyle( + color: Color(0xff767676), + fontFamily: 'Pretendard', + fontSize: 12.sp, + fontWeight: FontWeight.w400, + letterSpacing: 0.3, + ), + ), + ) + ], + ), + endDrawer: CustomDrawerScreen(), + )); } } @@ -348,43 +192,9 @@ class CustomButton_main extends StatelessWidget { } } -class ListTile_main extends StatelessWidget { - final String text; - final String Menu_Icon; - final VoidCallback onTap; - - const ListTile_main({ - required this.text, - required this.Menu_Icon, - required this.onTap - }); +class resign_Button extends StatelessWidget { @override - Widget build(BuildContext context){ - return ListTile( - leading: SvgPicture.asset(Menu_Icon), - title: Text( - text, - style: TextStyle( - color: Colors.black, - fontFamily: 'Pretendard', - fontSize: 16.sp, - fontStyle: FontStyle.normal, - fontWeight: FontWeight.w400, - letterSpacing: -0.4.sp, - ), - ), - onTap: onTap, - trailing: Image.asset( - 'asstes/Vector6.png', - scale: 4.sp, - ) - ); - } -} - -class resign_Button extends StatelessWidget{ - @override - Widget build(BuildContext context){ + Widget build(BuildContext context) { return TextButton( onPressed: () {}, child: Text( @@ -398,8 +208,7 @@ class resign_Button extends StatelessWidget{ letterSpacing: 0.3.sp, ), ), - style: TextButton.styleFrom( - padding: EdgeInsets.zero), + style: TextButton.styleFrom(padding: EdgeInsets.zero), ); } -} \ No newline at end of file +} diff --git a/lib/views/signup_done.dart b/lib/views/signup_done.dart index 4820a06..a6db652 100644 --- a/lib/views/signup_done.dart +++ b/lib/views/signup_done.dart @@ -1,6 +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/NormalAlertDialogWidget.dart'; import 'package:suwon/views/widgets/csbutton.dart'; import 'package:suwon/views/login_screen.dart'; @@ -111,7 +111,7 @@ class _SignUpDoneState extends State { text: '메일 재발송', backgroundColor: Color(0xFF111111), onPressed: () { - NormalAlertDialog( + NormalAlertDialogWidget( title: "알림", message: "포털 메일이 재발송되었습니다.", onClose: () { diff --git a/lib/views/widgets/cancel_and_action_alert_dialog.dart b/lib/views/widgets/CancelAndActionAlertDialogWidget.dart similarity index 92% rename from lib/views/widgets/cancel_and_action_alert_dialog.dart rename to lib/views/widgets/CancelAndActionAlertDialogWidget.dart index 6188789..2c3642d 100644 --- a/lib/views/widgets/cancel_and_action_alert_dialog.dart +++ b/lib/views/widgets/CancelAndActionAlertDialogWidget.dart @@ -1,12 +1,12 @@ import 'package:flutter/cupertino.dart'; -class CancelAndActionAlertDialog { +class CancelAndActionAlertDialogWidget { final String title; final String action; final VoidCallback onCancel; final VoidCallback onAction; - CancelAndActionAlertDialog({ + CancelAndActionAlertDialogWidget({ required this.title, required this.action, required this.onCancel, diff --git a/lib/views/widgets/normal_alert_dialog.dart b/lib/views/widgets/NormalAlertDialogWidget.dart similarity index 92% rename from lib/views/widgets/normal_alert_dialog.dart rename to lib/views/widgets/NormalAlertDialogWidget.dart index 0280c60..209ad5c 100644 --- a/lib/views/widgets/normal_alert_dialog.dart +++ b/lib/views/widgets/NormalAlertDialogWidget.dart @@ -1,11 +1,11 @@ import 'package:flutter/cupertino.dart'; -class NormalAlertDialog { +class NormalAlertDialogWidget { final String title; final String message; final VoidCallback onClose; - NormalAlertDialog({ + NormalAlertDialogWidget({ required this.title, required this.message, required this.onClose,