Skip to content

Commit

Permalink
Feat: MyPage, SettingPage
Browse files Browse the repository at this point in the history
  • Loading branch information
devlwh0830 committed Oct 23, 2024
1 parent 9e0d197 commit 05fbf86
Show file tree
Hide file tree
Showing 14 changed files with 11,656 additions and 44 deletions.
12 changes: 5 additions & 7 deletions lib/screens/mypage/edit_profile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,12 @@ class _EditProfileState extends State<EditProfile> {
children: [
SizedBox(
width: double.infinity,
height: 100,
child: CircleAvatar(
radius: 50,
child: ClipRRect(
borderRadius: BorderRadius.circular(50),
child: Image.network(
data.profileImage == null ? "https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_1280.png" : data.profileImage.toString(),
),
)
radius: 40,
backgroundImage: NetworkImage(
data.profileImage?.url ?? "https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_1280.png",
),
),
),
const SizedBox(
Expand Down
19 changes: 14 additions & 5 deletions lib/screens/mypage/mypage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import 'package:flutter/widgets.dart';
import 'package:saphy/models/memberinfo.dart';
import 'package:saphy/screens/mypage/edit_profile.dart';
import 'package:saphy/screens/mypage/setting.dart';
import 'package:saphy/screens/mypage/setting_page/personalinformation.dart';
import 'package:saphy/screens/mypage/setting_page/terms.dart';
import 'package:saphy/service/authentication/secure_storage.dart';
import 'package:saphy/utils/colors.dart';
import 'package:saphy/utils/textstyles.dart';
Expand Down Expand Up @@ -101,7 +103,7 @@ class _MyPageState extends State<MyPage> {
CircleAvatar(
radius: 40,
backgroundImage: NetworkImage(
data.profileImage == null ? "https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_1280.png" : data.profileImage.toString(),
data.profileImage?.url ?? "https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_1280.png",
),
),
const SizedBox(width: 20),
Expand Down Expand Up @@ -561,7 +563,12 @@ class _MyPageState extends State<MyPage> {
children: [
TextButton(
onPressed: () {

// 공지사항이 없다고 알림
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text("공지사항이 없습니다."),
),
);
},
style: ButtonStyle(
overlayColor: WidgetStateProperty.all(Colors.transparent),
Expand All @@ -583,7 +590,8 @@ class _MyPageState extends State<MyPage> {
),
TextButton(
onPressed: () {

Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => const Terms()));
},
style: ButtonStyle(
overlayColor: WidgetStateProperty.all(Colors.transparent),
Expand All @@ -604,8 +612,9 @@ class _MyPageState extends State<MyPage> {
color: Colors.black26,
),
TextButton(
onPressed: () async {
await getMemberInfo();
onPressed: () {
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => const PersonalInformation()));
},
style: ButtonStyle(
overlayColor: WidgetStateProperty.all(Colors.transparent),
Expand Down
64 changes: 45 additions & 19 deletions lib/screens/mypage/setting.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:saphy/screens/mypage/setting_page/address.dart';
import 'package:saphy/screens/mypage/setting_page/cashreceipt.dart';
import 'package:saphy/screens/mypage/setting_page/login_info.dart';
import 'package:saphy/screens/mypage/setting_page/notice.dart';
import 'package:saphy/screens/mypage/setting_page/oss_page.dart';
import 'package:saphy/screens/mypage/setting_page/payments.dart';
import 'package:saphy/screens/mypage/setting_page/personalinformation.dart';
import 'package:saphy/screens/mypage/setting_page/terms.dart';
import 'package:saphy/screens/welcome/welcome_screen.dart';
import 'package:saphy/service/authentication/google_login_controller.dart';
import 'package:saphy/service/authentication/kakao_login_controller.dart';
Expand Down Expand Up @@ -53,30 +60,37 @@ class _SettingPageState extends State<SettingPage> {
builder: (context) => const LoginInfo()));
},
),
const SettingMenu(
SettingMenu(
title: "주소록",
icon: Icons.list_alt,
onTap: null,
onTap: (){
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => const AddressList()));
},
),
const SettingMenu(
SettingMenu(
title: "결제 정보",
icon: Icons.credit_card,
onTap: null,
),
const SettingMenu(
title: "판매 정산 계좌",
icon: Icons.monetization_on_outlined,
onTap: null,
onTap: (){
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => const PaymentsList()));
},
),
const SettingMenu(
SettingMenu(
title: "현금영수증 정보",
icon: Icons.receipt_long,
onTap: null,
onTap: (){
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => const CashReceipt()));
},
),
const SettingMenu(
SettingMenu(
title: "알림",
icon: Icons.notifications_none,
onTap: null,
onTap: (){
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => const NoticeSetting()));
},
),
const SizedBox(
height: 20,
Expand All @@ -88,20 +102,32 @@ class _SettingPageState extends State<SettingPage> {
const SizedBox(
height: 10,
),
const SettingMenu(
SettingMenu(
title: "이용약관",
icon: Icons.list_alt_sharp,
onTap: null,
onTap: (){
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => const Terms()));
},
),
const SettingMenu(
SettingMenu(
title: "개인정보처리방침",
icon: Icons.security,
onTap: null,
onTap: (){
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => const PersonalInformation()));
},
),
const SettingMenu(
SettingMenu(
title: "오픈소스 라이선스",
icon: Icons.code_rounded,
onTap: null,
onTap: (){
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => const OssPage()));
},
),
const SizedBox(
height: 20,
),
NormalButton(
title: '로그아웃',
Expand Down
122 changes: 122 additions & 0 deletions lib/screens/mypage/setting_page/address.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
import 'package:flutter/material.dart';

class AddressList extends StatefulWidget {
const AddressList({super.key});

@override
State<AddressList> createState() => _AddressListState();
}

class _AddressListState extends State<AddressList> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBar(
title: const Text(
"주소록",
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 20,
fontFamily: "Pretendard",
),
),
backgroundColor: Colors.white,
centerTitle: true,
),
body: const Padding(
padding: EdgeInsets.all(20.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// 주소록 추가 버튼
SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: null,
child: Text(
"새로운 주소 추가",
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
),
),
// 주소록 리스트
SizedBox(
height: 10,
),
AddressItem(
title: "집",
address: "서울시 강남구 역삼동 123-456",
),
AddressItem(
title: "학교",
address: "경기도 수원시 영통구 광교산로 154-42",
),
AddressItem(
title: "친구집",
address: "서울시 강남구 역삼동 123-456",
),
],
),
),
);
}
}

class AddressItem extends StatelessWidget {
final String title;
final String address;

const AddressItem({super.key, required this.title, required this.address});

@override
Widget build(BuildContext context) {
return Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
Text(
address,
style: const TextStyle(
fontSize: 15,
),
),
const SizedBox(
height: 10,
),
],
),
const Spacer(),
// 수정 및 삭제 버튼
Row(
children: [
IconButton(
onPressed: (){

},
icon: const Icon(Icons.edit),
),
IconButton(
onPressed: (){

},
icon: const Icon(Icons.delete),
),
],
),
],
);
}
}
Loading

0 comments on commit 05fbf86

Please sign in to comment.