Skip to content

Commit

Permalink
Merge branch 'main' into feature/#8-Home
Browse files Browse the repository at this point in the history
  • Loading branch information
codeJiwon authored Nov 19, 2023
2 parents 92313ff + c83697b commit f90075f
Show file tree
Hide file tree
Showing 5 changed files with 299 additions and 98 deletions.
1 change: 1 addition & 0 deletions unibond/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class MyApp extends StatelessWidget {
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blueAccent),
useMaterial3: true,
),

home: const HomeScreen(), // 임시 스플래시화면
);
}
Expand Down
148 changes: 148 additions & 0 deletions unibond/lib/screens/board/board_comment.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
import 'package:flutter/material.dart';

class PostDetailsScreen extends StatefulWidget {
@override
_PostDetailsScreenState createState() => _PostDetailsScreenState();
}

class _PostDetailsScreenState extends State<PostDetailsScreen> {
List<Comment> comments = [];

TextEditingController commentController = TextEditingController();

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('질문'),
),
body: ListView(
children: [
// 게시물
Container(
padding: EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'진지지',
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 7.0),
Text(
'망막색소변성증',
style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.bold,
),
),
Text(
'게시물 내용',
style: TextStyle(fontSize: 18.0),
),
],
),
),
// 댓글
Container(
padding: EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'댓글',
style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 8.0),
for (var comment in comments)
CommentWidget(
author: comment.author,
comment: comment.comment,
),
],
),
),

Container(
padding: EdgeInsets.all(16.0),
child: Row(
children: [
Expanded(
child: TextField(
controller: commentController,
decoration: InputDecoration(
hintText: '댓글을 작성하세요',
),
),
),
SizedBox(width: 8.0),
InkWell(
onTap: () {
if (commentController.text.isNotEmpty) {
addComment();
}
},
child: Icon(
Icons.send,
color: Colors.blue,
),
),
],
),
),
],
),
);
}

void addComment() {
setState(() {
comments.add(
Comment(
author: '지지진',
comment: commentController.text,
),
);
commentController.clear();
});
}
}

class Comment {
final String author;
final String comment;

Comment({required this.author, required this.comment});
}

class CommentWidget extends StatelessWidget {
final String author;
final String comment;

CommentWidget({required this.author, required this.comment});

@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(bottom: 8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'$author 님의 댓글',
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
Text(comment),
],
),
);
}
}
1 change: 0 additions & 1 deletion unibond/lib/screens/community/post_detail_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class DetailScreen extends StatelessWidget {
IconButton(
icon: const Icon(Icons.more_vert),
onPressed: () {
//
showModalBottomSheet<void>(
context: context,
builder: (BuildContext context) {
Expand Down
197 changes: 125 additions & 72 deletions unibond/lib/screens/user/profile_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,101 +3,154 @@ import 'package:unibond/screens/home_screen.dart';
import 'package:unibond/screens/letter/letter_box_screen.dart';
import 'package:unibond/widgets/navigator.dart';

@override
Widget build(BuildContext context) {
return const MaterialApp(
home: ProfileScreen(),
);
}

class ProfileScreen extends StatelessWidget {
const ProfileScreen({super.key});
const ProfileScreen({Key? key});

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: Builder(
builder: (BuildContext context) {
return IconButton(
icon: const Icon(Icons.menu),
onPressed: () {
Scaffold.of(context).openDrawer();
},
);
},
),
title: Text('프로필 화면'),
),
drawer: Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: <Widget>[
ListTile(
title: const Text('사용설명서'),
onTap: () {
//내용
Navigator.pop(context); // 사이드 메뉴 닫기
},
),
ListTile(
title: const Text('즐겨찾는 편지'),
onTap: () {
//내용
Navigator.pop(context); // 사이드 메뉴 닫기
},
),
ListTile(
title: const Text('고객센터'),
onTap: () {
//내용
Navigator.pop(context); // 사이드 메뉴 닫기
},
),
ListTile(
title: const Text('이용약관 및 정책'),
onTap: () {
//내용
Navigator.pop(context); // 사이드 메뉴 닫기
},
),
ListTile(
title: const Text('버전 정보'),
onTap: () {
//내용
Navigator.pop(context); // 사이드 메뉴 닫기
},
body: ListView(
children: [
Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Stack(
alignment: Alignment.bottomRight,
children: [
ClipOval(
child: Image.asset(
'assets/images/user_image.jpg',
width: 100,
height: 100,
),
),
Container(
margin: const EdgeInsets.all(3),
padding: const EdgeInsets.all(3),
decoration: BoxDecoration(
color: Colors.grey,
shape: BoxShape.circle,
),
child: const Icon(Icons.settings),
),
],
),
Text(
'지지진',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
margin: const EdgeInsets.all(12),
width: 140,
height: 70,
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: Colors.grey[300],
borderRadius: BorderRadius.circular(10),
),
child: Column(
children: [
Text(
'질환정보',
style: TextStyle(
fontSize: 13,
color: Colors.grey,
),
),
Text(
'망막색소변성증',
style: TextStyle(
fontSize: 13,
),
),
],
),
),
Container(
margin: const EdgeInsets.all(12),
width: 140,
height: 70,
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: Colors.grey[300],
borderRadius: BorderRadius.circular(10),
),
child: Column(
children: [
Text(
'진단 시기',
style: TextStyle(
fontSize: 13,
color: Colors.grey,
),
),
Text(
'2001.01.25',
style: TextStyle(
fontSize: 13,
),
),
],
),
),
],
),
ListTile(
title: const Text('사용설명서'),
onTap: () {},
),
ListTile(
title: const Text('즐겨찾는 편지'),
onTap: () {},
),
ListTile(
title: const Text('고객센터'),
onTap: () {},
),
ListTile(
title: const Text('이용약관 및 정책'),
onTap: () {},
),
ListTile(
title: const Text('버전 정보'),
onTap: () {},
),
],
),
],
),
),
body: const Center(
child: Text('메인 화면 내용'),
),
],
),
bottomNavigationBar: MyBottomNavigationBar(
// 현재 선택된 바텀 바 아이콘 인덱스
currentIndex: 0,
onTap: (index) {
// 바텀 바 아이콘을 누를 때 화면 전환
if (index == 0) {
// 홈 화면으로 이동
Navigator.pushReplacement(
context,
MaterialPageRoute(builder: (context) => const HomeScreen()),
);
} else if (index == 1) {
//편지함 화면으로 이동
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => LetterBoxScreen(
fakeEnvelopes: [
LetterEnvelope(date: '2023-10-15', sender: '지지진'),
LetterEnvelope(date: '2023-10-14', sender: '진지지'),
],
)),
builder: (context) => LetterBoxScreen(
fakeEnvelopes: [
LetterEnvelope(date: '2023-10-15', sender: '지지진'),
LetterEnvelope(date: '2023-10-14', sender: '진지지'),
],
),
),
);
} else if (index == 2) {
// 프로필 화면으로 이동
Navigator.pushReplacement(
context,
MaterialPageRoute(builder: (context) => const ProfileScreen()),
Expand Down
Loading

0 comments on commit f90075f

Please sign in to comment.