Browse Source

fix group chat invite better print

pull/18/head
Sun 4 years ago
parent
commit
07b25fdc99
  1. 9
      lib/widgets/chat_message.dart

9
lib/widgets/chat_message.dart

@ -30,7 +30,7 @@ class ChatMessage extends StatelessWidget { @@ -30,7 +30,7 @@ class ChatMessage extends StatelessWidget {
const ChatMessage({Key? key, required this.fgid, required this.name, required this.message, this.avatar}): super(key: key);
Widget _showContactCard(Widget avatar, String gid, String name, String title, ColorScheme color) {
Widget _showContactCard(Widget avatar, String gid, String name, String title, ColorScheme color, [String pre='EH']) {
return Container(
padding: const EdgeInsets.only(top: 10, bottom: 6.0, left: 10.0, right: 10.0),
width: 200.0,
@ -43,7 +43,7 @@ class ChatMessage extends StatelessWidget { @@ -43,7 +43,7 @@ class ChatMessage extends StatelessWidget {
child: Column(children: [
Text(name, maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle(color: color.onPrimary, fontSize: 16.0)),
const SizedBox(height: 4.0),
Text(gidPrint(gid), style: TextStyle(color: Colors.grey, fontSize: 12.0)),
Text(gidPrint(gid, pre), style: TextStyle(color: Colors.grey, fontSize: 12.0)),
]))]),
const SizedBox(height: 5.0),
const Divider(height: 1.0, color: Color(0x40ADB0BB)),
@ -247,14 +247,13 @@ class ChatMessage extends StatelessWidget { @@ -247,14 +247,13 @@ class ChatMessage extends StatelessWidget {
// contact [type, gid, addr, name, proof, key]
final infos = message.showInvite();
if (infos[1].length > 0) {
final gid = 'EG' + infos[1].toUpperCase();
final GroupType gtype = infos[0];
return GestureDetector(
onTap: () => showShadowDialog(
context,
Icons.groups_rounded,
lang.groupChat,
UserInfo(showQr: false, id: gid, addr: '0x' + infos[2], name: infos[3],
UserInfo(showQr: false, id: infos[1], addr: infos[2], name: infos[3], pre: 'EG',
title: gtype.lang(lang),
avatar: Container(width: 100.0, height: 100.0,
padding: const EdgeInsets.all(8.0),
@ -274,7 +273,7 @@ class ChatMessage extends StatelessWidget { @@ -274,7 +273,7 @@ class ChatMessage extends StatelessWidget {
decoration: BoxDecoration(color: color.surface, borderRadius: BorderRadius.circular(10.0)),
child: Icon(Icons.groups_rounded, color: color.primary, size: 20.0),
),
gid, infos[3], lang.groupChat, color)
infos[1], infos[3], lang.groupChat, color, 'EG')
);
} else {
return _showText(context, color, maxWidth);

Loading…
Cancel
Save