IOS 채팅기능 추가 및 방설정버그 수정 적용 배포 버전1.1.0

This commit is contained in:
eld_master 2025-02-17 17:08:01 +09:00
parent d07c6f93dd
commit 67faa04935
7 changed files with 74 additions and 49 deletions

View File

@ -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 {

View File

@ -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';
//

View File

@ -79,9 +79,9 @@ class _ChatDialogState extends State<ChatDialog> {
_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<ChatDialog> {
}
});
// timestamp
messages.sort((a, b) => a.timestamp.compareTo(b.timestamp));
setState(() => _messages = messages);
_scrollToBottom();
} catch (e) {
@ -162,6 +165,7 @@ class _ChatDialogState extends State<ChatDialog> {
@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<ChatDialog> {
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<ChatDialog> {
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<ChatDialog> {
],
),
),
const Divider(),
Divider(color: Colors.grey[300]),
],
//
Expanded(
@ -269,6 +276,7 @@ class _ChatDialogState extends State<ChatDialog> {
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<ChatDialog> {
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(
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(
ConstrainedBox(
constraints: BoxConstraints(
maxWidth: MediaQuery.of(context).size.width * 0.7,
),
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: 12,
vertical: 8,
),
decoration: BoxDecoration(
color: isMyMessage ? Colors.blue[100] : Colors.white,
color: isMyMessage ? Colors.grey[800] : Colors.white,
borderRadius: BorderRadius.circular(16),
border: Border.all(
color: Colors.grey[300]!,
),
),
child: Text(message.message),
child: Text(
message.message,
style: TextStyle(
fontSize: 14,
height: 1.3,
color: isMyMessage ? Colors.white : Colors.black,
),
softWrap: true,
),
),
),
],
),
@ -338,7 +361,10 @@ class _ChatDialogState extends State<ChatDialog> {
),
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,
);
}

View File

@ -271,22 +271,17 @@ class _SignUpDialogState extends State<SignUpDialog> {
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.');

View File

@ -153,6 +153,11 @@ class _PlayingPrivatePageState extends State<PlayingPrivatePage> {
final List<Map<String, dynamic>> 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<PlayingPrivatePage> {
// 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(),

View File

@ -155,6 +155,11 @@ class _PlayingTeamPageState extends State<PlayingTeamPage> {
final List<Map<String, dynamic>> 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<PlayingTeamPage> {
// ()
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(),

View File

@ -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"