Skip to content

Commit

Permalink
#132 feat: 쪽지 전송 화면 구현중 중간저장
Browse files Browse the repository at this point in the history
  • Loading branch information
Nya128 committed Dec 31, 2023
1 parent 2d5f7b6 commit 20f643e
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 28 deletions.
25 changes: 15 additions & 10 deletions lib/chat/view/chat_room_screen.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:psr/chat/view/chat_sending_screen.dart';

import '../../common/const/colors.dart';
import '../../presenter/chat/chat_service.dart';
Expand Down Expand Up @@ -66,11 +67,15 @@ class _ChatRoomScreenState extends State<ChatRoomScreen> {
preferredSize: const Size.fromHeight(48.0),
child: chatRoomAppBar(),
),
body: Expanded(
child: SingleChildScrollView(
child: chatContentView(),
),
),
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: chatContentView(),
),
),
],
)
);
}

Expand All @@ -97,7 +102,11 @@ class _ChatRoomScreenState extends State<ChatRoomScreen> {
width: 20,
height: 20,
),
onPressed: goToMsgSendingScreen(),
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (_) => const ChatSendingScreen(), fullscreenDialog: true
));
},
),
IconButton(
icon: SvgPicture.asset('asset/icons/shopping/more_vertical.svg'),
Expand Down Expand Up @@ -198,10 +207,6 @@ class _ChatRoomScreenState extends State<ChatRoomScreen> {
);
}

goToMsgSendingScreen() {

}

void showReportDialog() {

}
Expand Down
21 changes: 3 additions & 18 deletions lib/chat/view/chat_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ class ChatScreen extends StatefulWidget {
class _ChatScreenState extends State<ChatScreen> {
final TextStyle chatTitleTextStyle = const TextStyle(
fontSize: 16.0, fontWeight: FontWeight.w700, color: Colors.black);
final TextStyle chatPreparationTextStyle = const TextStyle(
fontSize: 18.0, fontWeight: FontWeight.w700, color: GRAY_4_COLOR);

// late List<ChatModel?> chatList;
/// 더미데이터(사진/닉네임/마지막 채팅/날짜/안 읽은 채팅 수)
Expand Down Expand Up @@ -72,13 +70,10 @@ class _ChatScreenState extends State<ChatScreen> {
children: [
chatHeader(),
Expanded(
child: chatPreparationText(),
child: SingleChildScrollView(
child: ChatListItem(context: context, chatList: chatList),
),
),
// Expanded(
// child: SingleChildScrollView(
// child: ChatListItem(context: context, chatList: chatList),
// ),
// ),
],
);
}
Expand All @@ -99,14 +94,4 @@ class _ChatScreenState extends State<ChatScreen> {
)
);
}

Widget chatPreparationText() {
return Center(
child: Text(
"쪽지 기능 준비 중입니다.\n조금만 기다려주세요!",
style: chatPreparationTextStyle,
textAlign: TextAlign.center,
)
);
}
}
68 changes: 68 additions & 0 deletions lib/chat/view/chat_sending_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import 'package:flutter/material.dart';

import '../../common/const/colors.dart';

class ChatSendingScreen extends StatefulWidget {
const ChatSendingScreen({Key? key}) : super(key: key);

@override
State<ChatSendingScreen> createState() => _ChatSendingScreenState();
}

class _ChatSendingScreenState extends State<ChatSendingScreen> {
final ScrollController _scrollController = ScrollController();
final TextStyle titleTextStyle = const TextStyle(
fontSize: 15.0, fontWeight: FontWeight.w500, color: GRAY_4_COLOR);
final TextStyle messageTextStyle = const TextStyle(
fontSize: 14.0, fontWeight: FontWeight.w400, color: GRAY_4_COLOR);
final TextStyle hintTextStyle = const TextStyle(
fontSize: 14.0, fontWeight: FontWeight.w400, color: GRAY_1_COLOR);

@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
appBar: PreferredSize(
preferredSize: const Size.fromHeight(48.0),
child: chatSendingScreenAppBar(),
),
body: messageInputView(),
);
}

Widget chatSendingScreenAppBar() {
return AppBar(
backgroundColor: Colors.white,
elevation: 0,
scrolledUnderElevation: 0.0,
title: Text(
"쪽지 보내기",
style: titleTextStyle,
),
actions: [
/// 전송 버튼
],
);
}

Widget messageInputView() {
return Scrollbar(
controller: _scrollController,
child: TextField(
scrollController: _scrollController,
autocorrect: false,
keyboardType: TextInputType.multiline,
style: messageTextStyle,
minLines: null,
maxLines: null,
decoration: InputDecoration(
isDense: true,
contentPadding: const EdgeInsets.fromLTRB(16.0, 10.0, 16.0, 24.0),
border: InputBorder.none,
hintText: "메시지를 입력하세요.",
hintStyle: hintTextStyle,
),
),
);
}
}

0 comments on commit 20f643e

Please sign in to comment.