убрал говно за инвисом
This commit is contained in:
@@ -1042,6 +1042,7 @@ class _ChatListScreenState extends State<ChatListScreen>
|
||||
isOnline: chat.isOnline,
|
||||
unreadCount: chat.unreadCount,
|
||||
isMuted: chat.dontDisturbUntil > 0,
|
||||
chatType: "DIALOG",
|
||||
);
|
||||
} else {
|
||||
if (chat.lastMsgSenderId != null ) {
|
||||
@@ -1077,6 +1078,7 @@ class _ChatListScreenState extends State<ChatListScreen>
|
||||
isOnline: chat.isOnline,
|
||||
unreadCount: chat.unreadCount,
|
||||
isMuted: chat.dontDisturbUntil > 0,
|
||||
chatType: chat.type,
|
||||
);
|
||||
}
|
||||
}, childCount: _isInitialLoading ? 10 : chats.length),
|
||||
@@ -1679,6 +1681,7 @@ class _ChatListScreenState extends State<ChatListScreen>
|
||||
bool isRead = false,
|
||||
int unreadCount = 0,
|
||||
bool isMuted = false,
|
||||
String chatType = "CHAT",
|
||||
}) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
final isSelected = _selectedChats.contains(id);
|
||||
@@ -1688,16 +1691,17 @@ class _ChatListScreenState extends State<ChatListScreen>
|
||||
if (_isSelectionMode) {
|
||||
_toggleSelection(id);
|
||||
} else {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ChatScreen(
|
||||
chatId: int.parse(id),
|
||||
name: name,
|
||||
imageUrl: imageUrl,
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ChatScreen(
|
||||
chatId: int.parse(id),
|
||||
name: name,
|
||||
imageUrl: imageUrl,
|
||||
chatType: chatType,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
);
|
||||
}
|
||||
},
|
||||
onLongPress: () => _toggleSelection(id),
|
||||
|
||||
@@ -14,12 +14,14 @@ class ChatScreen extends StatefulWidget {
|
||||
final int chatId;
|
||||
final String name;
|
||||
final String imageUrl;
|
||||
final String chatType;
|
||||
|
||||
const ChatScreen({
|
||||
super.key,
|
||||
required this.chatId,
|
||||
required this.name,
|
||||
required this.imageUrl,
|
||||
required this.chatType,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -469,6 +471,43 @@ class _ChatScreenState extends State<ChatScreen>
|
||||
Widget _buildInputArea(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
final mutedIcon = cs.onSurfaceVariant.withValues(alpha: 0.85);
|
||||
|
||||
if (widget.chatType == "CHANNEL") {
|
||||
return SafeArea(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0),
|
||||
child: GestureDetector(
|
||||
onTap: () {},
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
decoration: BoxDecoration(
|
||||
color: Color.alphaBlend(
|
||||
cs.surfaceContainerHighest.withValues(alpha: 0.92),
|
||||
cs.surface,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(28),
|
||||
border: Border.all(
|
||||
color: cs.outlineVariant.withValues(alpha: 0.5),
|
||||
width: 0.5,
|
||||
),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'Отключить уведомления',
|
||||
style: TextStyle(
|
||||
color: cs.onSurface,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return SafeArea(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0),
|
||||
|
||||
@@ -296,41 +296,41 @@ class MessageBubble extends StatelessWidget {
|
||||
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: isMe ? 60 : 12,
|
||||
right: isMe ? 12 : 60,
|
||||
left: isMe ? 12 : 12,
|
||||
right: isMe ? 12 : 12,
|
||||
top: topMargin,
|
||||
bottom: bottomMargin,
|
||||
),
|
||||
child: Align(
|
||||
child: Row(
|
||||
mainAxisAlignment: isMe ? MainAxisAlignment.end : MainAxisAlignment.start,
|
||||
spacing: 8.0,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
if (senderAvatar != null && senderAvatar.isNotEmpty && !isMe && chatType != "DIALOG"
|
||||
&& nextMessage?.senderId != message.senderId && prevMessage?.senderId == message.senderId)
|
||||
CircleAvatar(
|
||||
radius: 15,
|
||||
backgroundImage: NetworkImage(senderAvatar),
|
||||
backgroundColor: cs.primaryContainer,
|
||||
)
|
||||
else if (displaySender != null && !isMe && chatType != "DIALOG"
|
||||
&& nextMessage?.senderId != message.senderId && prevMessage?.senderId == message.senderId)
|
||||
CircleAvatar(
|
||||
radius: 15,
|
||||
backgroundColor: cs.primaryContainer,
|
||||
child: Text(
|
||||
displaySender!.isNotEmpty
|
||||
? displaySender[0].toUpperCase()
|
||||
: '?',
|
||||
style: TextStyle(fontSize: 9, color: cs.onPrimaryContainer),
|
||||
),
|
||||
)
|
||||
// Заглушка для паддинга
|
||||
else
|
||||
CircleAvatar(
|
||||
radius: 15,
|
||||
backgroundColor: Color(0x00000000)
|
||||
),
|
||||
if (!isMe && chatType == "CHAT" && nextMessage?.senderId != message.senderId && prevMessage?.senderId == message.senderId)
|
||||
...(senderAvatar != null && senderAvatar.isNotEmpty)
|
||||
? [
|
||||
CircleAvatar(
|
||||
radius: 15,
|
||||
backgroundImage: NetworkImage(senderAvatar),
|
||||
backgroundColor: cs.primaryContainer,
|
||||
)
|
||||
]
|
||||
: [
|
||||
CircleAvatar(
|
||||
radius: 15,
|
||||
backgroundColor: cs.primaryContainer,
|
||||
child: Text(
|
||||
displaySender != null && displaySender.isNotEmpty
|
||||
? displaySender[0].toUpperCase()
|
||||
: '?',
|
||||
style: TextStyle(fontSize: 9, color: cs.onPrimaryContainer),
|
||||
),
|
||||
)
|
||||
]
|
||||
else if (!isMe && chatType != "CHAT")
|
||||
SizedBox(width: 0)
|
||||
else if (!isMe)
|
||||
CircleAvatar(radius: 15, backgroundColor: Color(0x00000000)),
|
||||
Container(
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: MediaQuery.of(context).size.width * 0.75,
|
||||
@@ -389,11 +389,10 @@ class MessageBubble extends StatelessWidget {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (message.senderId != message.accountId && prevMessage?.senderId != message.senderId)
|
||||
if (message.senderId != message.accountId && prevMessage?.senderId != message.senderId && chatType == "CHAT")
|
||||
Text(
|
||||
displaySender ?? "",
|
||||
textAlign: TextAlign.left,
|
||||
// TODO: Получение цветов по хешу ника
|
||||
style: TextStyle(color: cs.onPrimaryContainer)
|
||||
),
|
||||
Row(
|
||||
|
||||
Reference in New Issue
Block a user