diff --git a/android/app/build.gradle b/android/app/build.gradle index 26921f1..5ef6650 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -20,8 +20,8 @@ android { applicationId "com.allscore_app" minSdkVersion 23 targetSdkVersion 34 - versionCode 18 - versionName "1.0.18" + versionCode 19 + versionName "1.1.0" } signingConfigs { release { diff --git a/lib/config/config.dart b/lib/config/config.dart index 23e4413..8168799 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -6,9 +6,9 @@ class Config { // 실제 광고 단위 ID - ios // static const String realAdUnitId = 'ca-app-pub-6461991944599918/9704216771'; // 테스트 광고 단위 ID - static const String adUnitId = 'ca-app-pub-3940256099942544/6300978111'; // 테스트 + // static const String adUnitId = 'ca-app-pub-3940256099942544/6300978111'; // 테스트 // static const String adUnitId = 'ca-app-pub-6461991944599918/5107596297'; // android - // static const String adUnitId = 'ca-app-pub-6461991944599918/9704216771'; // ios + static const String adUnitId = 'ca-app-pub-6461991944599918/9704216771'; // ios // 서버 주소 static const String baseUrl = 'https://d2zcnlqji5t7mh.cloudfront.net'; // 이미지 업로드 주소 diff --git a/lib/dialogs/chat_dialog.dart b/lib/dialogs/chat_dialog.dart index e7acfca..00dae27 100644 --- a/lib/dialogs/chat_dialog.dart +++ b/lib/dialogs/chat_dialog.dart @@ -79,9 +79,9 @@ class _ChatDialogState extends State { _chatRef = FirebaseDatabase.instance.ref(path); - // orderByKey()를 사용하여 메시지 ID(timestamp) 기준으로 정렬 + // orderByChild('timestamp')를 사용하여 timestamp 기준으로 정렬 _chatSubscription = _chatRef - .orderByKey() + .orderByChild('timestamp') .onValue .listen((event) { if (!event.snapshot.exists) { @@ -103,6 +103,9 @@ class _ChatDialogState extends State { } }); + // timestamp 기준으로 정렬 + messages.sort((a, b) => a.timestamp.compareTo(b.timestamp)); + setState(() => _messages = messages); _scrollToBottom(); } catch (e) { @@ -162,6 +165,7 @@ class _ChatDialogState extends State { @override Widget build(BuildContext context) { return Dialog( + backgroundColor: Colors.white, child: Container( width: MediaQuery.of(context).size.width * 0.8, height: MediaQuery.of(context).size.height * 0.7, @@ -190,8 +194,11 @@ class _ChatDialogState extends State { Container( margin: const EdgeInsets.symmetric(vertical: 8.0), decoration: BoxDecoration( - color: Colors.grey[200], + color: Colors.grey[100], borderRadius: BorderRadius.circular(25), + border: Border.all( + color: Colors.grey[300]!, + ), ), child: Row( children: [ @@ -211,7 +218,7 @@ class _ChatDialogState extends State { boxShadow: _selectedChatType == ChatType.all ? [ BoxShadow( - color: Colors.grey.withOpacity(0.3), + color: Colors.grey.withOpacity(0.1), blurRadius: 4, offset: const Offset(0, 2), ) @@ -260,7 +267,7 @@ class _ChatDialogState extends State { ], ), ), - const Divider(), + Divider(color: Colors.grey[300]), ], // 채팅 내용이 표시될 영역 Expanded( @@ -269,6 +276,7 @@ class _ChatDialogState extends State { decoration: BoxDecoration( color: Colors.grey[100], borderRadius: BorderRadius.circular(12), + border: Border.all(color: Colors.grey[200]!), ), child: ListView.builder( controller: _scrollController, @@ -279,34 +287,49 @@ class _ChatDialogState extends State { return Padding( padding: const EdgeInsets.symmetric(vertical: 4.0), - child: Row( - mainAxisAlignment: isMyMessage - ? MainAxisAlignment.end - : MainAxisAlignment.start, + child: Column( + crossAxisAlignment: isMyMessage ? CrossAxisAlignment.end : CrossAxisAlignment.start, children: [ - if (!isMyMessage) ...[ - Text( - message.senderNickname, - style: const TextStyle( - fontSize: 12, - color: Colors.grey, + if (!isMyMessage) + Padding( + padding: const EdgeInsets.only(left: 12.0, bottom: 4.0), + child: Text( + message.senderNickname, + style: const TextStyle( + fontSize: 12, + color: Colors.grey, + fontWeight: FontWeight.w500, + ), + overflow: TextOverflow.ellipsis, + maxLines: 1, ), ), - const SizedBox(width: 8), - ], - Container( - padding: const EdgeInsets.symmetric( - horizontal: 12, - vertical: 8, + ConstrainedBox( + constraints: BoxConstraints( + maxWidth: MediaQuery.of(context).size.width * 0.7, ), - decoration: BoxDecoration( - color: isMyMessage ? Colors.blue[100] : Colors.white, - borderRadius: BorderRadius.circular(16), - border: Border.all( - color: Colors.grey[300]!, + child: Container( + padding: const EdgeInsets.symmetric( + horizontal: 12, + vertical: 8, + ), + decoration: BoxDecoration( + color: isMyMessage ? Colors.grey[800] : Colors.white, + borderRadius: BorderRadius.circular(16), + border: Border.all( + color: Colors.grey[300]!, + ), + ), + child: Text( + message.message, + style: TextStyle( + fontSize: 14, + height: 1.3, + color: isMyMessage ? Colors.white : Colors.black, + ), + softWrap: true, ), ), - child: Text(message.message), ), ], ), @@ -338,7 +361,10 @@ class _ChatDialogState extends State { ), const SizedBox(width: 8), IconButton( - icon: const Icon(Icons.send), + icon: const Icon( + Icons.send, + color: Colors.black, // 아이콘 색상을 검은색으로 + ), onPressed: _sendMessage, ), ], @@ -385,7 +411,11 @@ class ChatButton extends StatelessWidget { Widget build(BuildContext context) { return FloatingActionButton( onPressed: () => _openChatDialog(context), - child: const Icon(Icons.chat), + child: const Icon( + Icons.chat, + color: Colors.white, // 아이콘 색상을 흰색으로 + ), + backgroundColor: Colors.black, // 버튼 배경색을 검은색으로 mini: true, ); } diff --git a/lib/dialogs/signup_dialog.dart b/lib/dialogs/signup_dialog.dart index fe92d02..9772b6a 100644 --- a/lib/dialogs/signup_dialog.dart +++ b/lib/dialogs/signup_dialog.dart @@ -271,22 +271,17 @@ class _SignUpDialogState extends State { AppleIDAuthorizationScopes.fullName, ], ); - print('appleCredential: $appleCredential'); // 2. Firebase credential 생성 final oauthProvider = OAuthProvider('apple.com'); - print('oauthProvider: $oauthProvider'); final credential = oauthProvider.credential( idToken: appleCredential.identityToken, accessToken: appleCredential.authorizationCode, ); - print('credential: $credential'); // 3. Firebase 인증 final userCredential = await FirebaseAuth.instance.signInWithCredential(credential); - print('userCredential: $userCredential'); final user = userCredential.user; - print('user: $user'); if (user == null) { showResponseDialog(context, 'Error', 'Apple account authentication failed.'); diff --git a/lib/views/room/playing_private_page.dart b/lib/views/room/playing_private_page.dart index 00029e5..6435cfe 100644 --- a/lib/views/room/playing_private_page.dart +++ b/lib/views/room/playing_private_page.dart @@ -153,6 +153,11 @@ class _PlayingPrivatePageState extends State { final List> rawList = []; userInfoData.forEach((uSeq, uData) { uSeq = uSeq.toString().replaceAll('_', ''); + // 채팅 데이터 세팅 + if (uSeq.toString() == mySeq) { + _teamName = uData['team_name'] ?? ''; + _myNickname = uData['nickname'] ?? ''; + } // Mark room master (방장 표시) if (uSeq == roomInfoData['master_user_seq'].toString()) { uData['nickname'] = '★' + (uData['nickname'] ?? 'User'); @@ -161,11 +166,6 @@ class _PlayingPrivatePageState extends State { // Mark admin (사회자 표시) uData['nickname'] = '☆' + (uData['nickname'] ?? 'User'); } - // 채팅 데이터 세팅 - if (uSeq.toString() == mySeq) { - _teamName = uData['team_name'] ?? ''; - _myNickname = uData['nickname'] ?? ''; - } rawList.add({ 'user_seq': uSeq, 'participant_type': (uData['participant_type'] ?? '').toString().toUpperCase(), diff --git a/lib/views/room/playing_team_page.dart b/lib/views/room/playing_team_page.dart index 8cfc6a2..7f1eef9 100644 --- a/lib/views/room/playing_team_page.dart +++ b/lib/views/room/playing_team_page.dart @@ -155,6 +155,11 @@ class _PlayingTeamPageState extends State { final List> rawList = []; userInfoData.forEach((uSeq, uData) { uSeq = uSeq.toString().replaceAll('_', ''); + // 채팅 데이터 세팅 + if (uSeq.toString() == mySeq) { + _teamName = uData['team_name'] ?? ''; + _myNickname = uData['nickname'] ?? ''; + } // Mark room master if (uSeq.toString() == roomInfoData['master_user_seq'].toString()) { // 방장 표시 @@ -163,11 +168,6 @@ class _PlayingTeamPageState extends State { // 관리자(사회자) 표시 uData['nickname'] = '☆' + (uData['nickname'] ?? 'User'); } - // 채팅 데이터 세팅 - if (uSeq.toString() == mySeq) { - _teamName = uData['team_name'] ?? ''; - _myNickname = uData['nickname'] ?? ''; - } rawList.add({ 'user_seq': uSeq, 'participant_type': (uData['participant_type'] ?? '').toString().toUpperCase(), diff --git a/pubspec.yaml b/pubspec.yaml index 4391cea..cdefc97 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: allscore_app description: "A new Flutter project." publish_to: 'none' -version: 1.0.18+18 +version: 1.1.0+19 environment: sdk: '>=3.5.3 <4.0.0' flutter: ">=3.16.0"