-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Feat/#20 마이 페이지 UI
- Loading branch information
Showing
7 changed files
with
213 additions
and
7 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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:frontend/colors/app_colors.dart'; | ||
import 'package:frontend/widgets/custom_bottom_navigation_bar.dart'; | ||
import 'package:frontend/widgets/my_app_bar.dart'; | ||
import 'package:frontend/widgets/bookmark_list_togle.dart'; | ||
import 'package:frontend/widgets/my_page_function_list.dart'; | ||
|
||
class MyPage extends StatefulWidget { | ||
const MyPage({super.key}); | ||
|
||
@override | ||
_MyPageState createState() => _MyPageState(); | ||
} | ||
|
||
class _MyPageState extends State<MyPage> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return const Scaffold( | ||
appBar: MyAppBar(), | ||
backgroundColor: AppColors.backgroundColor, | ||
body: Column( | ||
children: [ | ||
Padding( | ||
padding: EdgeInsets.only( | ||
top: 70.0, | ||
), | ||
child: Column( | ||
children: [ | ||
BookmarkListTogle(), | ||
SizedBox( | ||
height: 10, | ||
), | ||
MyPageFunctionList(), | ||
], | ||
), | ||
), | ||
], | ||
), | ||
bottomNavigationBar: CustomBottomNavigationBar(), | ||
); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class BookmarkListTogle extends StatefulWidget { | ||
const BookmarkListTogle({Key? key}) : super(key: key); | ||
|
||
@override | ||
_BookmarkListTogleState createState() => _BookmarkListTogleState(); | ||
} | ||
|
||
class _BookmarkListTogleState extends State<BookmarkListTogle> { | ||
bool isExpanded = false; | ||
|
||
void _toggleExpand() { | ||
setState(() { | ||
isExpanded = !isExpanded; | ||
}); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
color: Colors.orangeAccent, | ||
padding: const EdgeInsets.all(16.0), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
const Text( | ||
"오리님의 관심있는 컨텐츠", | ||
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold), | ||
), | ||
IconButton( | ||
icon: Icon(isExpanded ? Icons.remove : Icons.add), | ||
onPressed: _toggleExpand, | ||
), | ||
], | ||
), | ||
const SizedBox(height: 16.0), | ||
GridView.builder( | ||
shrinkWrap: true, | ||
physics: const NeverScrollableScrollPhysics(), | ||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( | ||
crossAxisCount: 3, // 한 줄에 3개의 항목 | ||
crossAxisSpacing: 10.0, | ||
mainAxisSpacing: 10.0, | ||
childAspectRatio: 1, // 정사각형 비율 | ||
), | ||
itemCount: isExpanded ? 9 : 3, // 확장 여부에 따른 항목 수 | ||
itemBuilder: (context, index) { | ||
return Column( | ||
children: [ | ||
Container( | ||
height: 80, | ||
width: 80, | ||
color: Colors.grey, | ||
), | ||
const SizedBox(height: 8), | ||
const Text( | ||
"도덕과 역대사이", | ||
style: TextStyle(fontSize: 12), | ||
), | ||
], | ||
); | ||
}, | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
frontend/lib/widgets/custom_app_bar.dart → frontend/lib/widgets/main_app_bar.dart
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_svg/flutter_svg.dart'; | ||
|
||
class MyAppBar extends StatelessWidget implements PreferredSizeWidget { | ||
const MyAppBar({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return AppBar( | ||
backgroundColor: Colors.transparent, | ||
elevation: 0, | ||
title: const Text('마이페이지'), | ||
actions: [ | ||
Padding( | ||
padding: const EdgeInsets.only(right: 20), | ||
child: SvgPicture.asset( | ||
'assets/icons/menu.svg', | ||
height: 20, | ||
), | ||
), | ||
], | ||
); | ||
} | ||
|
||
@override | ||
Size get preferredSize => const Size.fromHeight(kToolbarHeight); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class MyPageFunctionList extends StatelessWidget { | ||
const MyPageFunctionList({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
decoration: const BoxDecoration( | ||
border: Border( | ||
top: BorderSide(color: Colors.orange, width: 2.0), // 위쪽 실선 | ||
bottom: BorderSide(color: Colors.orange, width: 2.0), // 아래쪽 실선 | ||
), | ||
), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.stretch, | ||
children: [ | ||
_buildSettingsItem("포즈 정렬 수정"), | ||
_buildDottedDivider(), | ||
_buildSettingsItem("환경설정"), | ||
], | ||
), | ||
); | ||
} | ||
|
||
Widget _buildSettingsItem(String title) { | ||
return Padding( | ||
padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 8.0), | ||
child: Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
Text( | ||
title, | ||
style: const TextStyle( | ||
fontSize: 16, | ||
fontWeight: FontWeight.bold, | ||
), | ||
), | ||
const Icon( | ||
Icons.arrow_drop_down, | ||
color: Colors.orange, | ||
size: 24.0, // 더 큰 아이콘 크기 | ||
), | ||
], | ||
), | ||
); | ||
} | ||
|
||
Widget _buildDottedDivider() { | ||
return Container( | ||
margin: const EdgeInsets.symmetric(horizontal: 8.0), | ||
child: Row( | ||
children: List.generate( | ||
150 ~/ 5, | ||
(index) => Expanded( | ||
child: Container( | ||
color: index % 2 == 0 ? Colors.transparent : Colors.orange, | ||
height: 1, | ||
), | ||
)), | ||
), | ||
); | ||
} | ||
} |