From f6525d3b3856537c548d055830bc55dff065dee4 Mon Sep 17 00:00:00 2001 From: opjoobe Date: Fri, 29 Jul 2022 15:16:29 +0900 Subject: [PATCH] #61 fix: message socket fix (String -> int) --- lib/screens/message/chat_detail_page.dart | 4 ++-- lib/screens/mypage/profile_page.dart | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/screens/message/chat_detail_page.dart b/lib/screens/message/chat_detail_page.dart index 1d26f90..7e2e5ad 100644 --- a/lib/screens/message/chat_detail_page.dart +++ b/lib/screens/message/chat_detail_page.dart @@ -8,7 +8,7 @@ import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:intl/intl.dart'; class ChatScreen extends StatefulWidget { - var chatroomID; + int chatroomID; int loginID; int friendID; String friendName; @@ -33,7 +33,7 @@ class _ChatScreenState extends State { final TextEditingController _messageController = TextEditingController(); final ScrollController _scrollController = ScrollController(); - getChatMessages(chatroomid) async { + getChatMessages(int chatroomid) async { try { var dio = Dio(); Response response = await dio.get( diff --git a/lib/screens/mypage/profile_page.dart b/lib/screens/mypage/profile_page.dart index f3b1b07..1e4ba16 100644 --- a/lib/screens/mypage/profile_page.dart +++ b/lib/screens/mypage/profile_page.dart @@ -300,11 +300,12 @@ class _ProfilePageState extends State { var roomID = await getChatRoom(loginID, widget.friendId); if (!mounted) return; - if (int.parse(roomID) > 0) { + int chatroomID = int.parse(roomID); + if (chatroomID > 0) { Navigator.push(context, MaterialPageRoute(builder: (context) { return ChatScreen( - chatroomID: roomID, // chatroomID // 수정필요 + chatroomID: chatroomID, // chatroomID // 수정필요 loginID: loginID, friendID: widget.friendId!, // not isMe friendName: user.nickname,