Edited common reaction emojis, display user avatar in reaction overview
This commit is contained in:
parent
68bfe92849
commit
e01bb38af7
@ -176,12 +176,12 @@ class _ChatBubbleState extends State<ChatBubble> {
|
||||
),
|
||||
onLongPress: () {
|
||||
showDialog(context: context, builder: (context) {
|
||||
List<String> commonReactions = ["👍", "👎", "😆", "❤️", "💔", "😍"];
|
||||
bool reactable = widget.bubbleData.messageType == GetRoomResponseObjectMessageType.comment;
|
||||
List<String> commonReactions = ["👍", "👎", "😆", "❤️", "👀", "🤔"];
|
||||
bool canReact = widget.bubbleData.messageType == GetRoomResponseObjectMessageType.comment;
|
||||
return SimpleDialog(
|
||||
children: [
|
||||
Visibility(
|
||||
visible: reactable,
|
||||
visible: canReact,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
@ -211,7 +211,7 @@ class _ChatBubbleState extends State<ChatBubble> {
|
||||
)
|
||||
),
|
||||
Visibility(
|
||||
visible: reactable,
|
||||
visible: canReact,
|
||||
child: ListTile(
|
||||
leading: const Icon(Icons.add_reaction_outlined),
|
||||
title: const Text("Reaktionen"),
|
||||
|
@ -62,8 +62,6 @@ class _ChatListState extends State<ChatList> {
|
||||
).asDialog(context);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
void _query({bool renew = false}) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:jiffy/jiffy.dart';
|
||||
import 'package:marianum_mobile/widget/userAvatar.dart';
|
||||
import 'package:persistent_bottom_nav_bar/persistent_tab_view.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
@ -9,7 +10,6 @@ import '../../../api/marianumcloud/talk/room/getRoomResponse.dart';
|
||||
import '../../../api/marianumcloud/talk/setFavorite/setFavorite.dart';
|
||||
import '../../../api/marianumcloud/talk/setReadMarker/setReadMarker.dart';
|
||||
import '../../../api/marianumcloud/talk/setReadMarker/setReadMarkerParams.dart';
|
||||
import '../../../model/endpointData.dart';
|
||||
import '../../../widget/confirmDialog.dart';
|
||||
import '../../../widget/debug/debugTile.dart';
|
||||
import 'chatView.dart';
|
||||
@ -49,14 +49,8 @@ class _ChatTileState extends State<ChatTile> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
bool useRemotePicture = widget.data.type == GetRoomResponseObjectConversationType.oneToOne;
|
||||
CircleAvatar circleAvatar = CircleAvatar(
|
||||
foregroundImage: useRemotePicture ? Image.network("https://${EndpointData().nextcloud().full()}/avatar/${widget.data.name}/128").image : null,
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
foregroundColor: Colors.white,
|
||||
onForegroundImageError: useRemotePicture ? (o, t) {} : null,
|
||||
child: widget.data.type == GetRoomResponseObjectConversationType.group ? const Icon(Icons.group) : const Icon(Icons.person),
|
||||
);
|
||||
bool isGroup = widget.data.type == GetRoomResponseObjectConversationType.oneToOne;
|
||||
UserAvatar circleAvatar = UserAvatar(username: widget.data.name, isGroup: isGroup);
|
||||
|
||||
return ListTile(
|
||||
leading: Stack(
|
||||
|
@ -8,13 +8,14 @@ import '../../../api/marianumcloud/talk/room/getRoomResponse.dart';
|
||||
import '../../../theming/appTheme.dart';
|
||||
import '../../../model/chatList/chatProps.dart';
|
||||
import '../../../widget/loadingSpinner.dart';
|
||||
import '../../../widget/userAvatar.dart';
|
||||
import 'chatBubble.dart';
|
||||
import 'chatTextfield.dart';
|
||||
|
||||
class ChatView extends StatefulWidget {
|
||||
final GetRoomResponseObject room;
|
||||
final String selfId;
|
||||
final CircleAvatar avatar;
|
||||
final UserAvatar avatar;
|
||||
|
||||
const ChatView({Key? key, required this.room, required this.selfId, required this.avatar}) : super(key: key);
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:marianum_mobile/widget/userAvatar.dart';
|
||||
|
||||
import '../../../api/marianumcloud/talk/getReactions/getReactions.dart';
|
||||
import '../../../api/marianumcloud/talk/getReactions/getReactionsResponse.dart';
|
||||
@ -54,16 +55,20 @@ class _MessageReactionsState extends State<MessageReactions> {
|
||||
children: entry.value.map((e) {
|
||||
bool isSelf = AccountData().getUsername() == e.actorId;
|
||||
return ListTile(
|
||||
leading: const CenteredLeading(Icon(Icons.person)),
|
||||
leading: UserAvatar(username: e.actorId, isGroup: false),
|
||||
title: Text(e.actorDisplayName),
|
||||
subtitle: isSelf ? const Text("Du") : e.actorType == GetReactionsResponseObjectActorType.guests ? const Text("Gast") : null,
|
||||
trailing: isSelf ? null : Visibility(
|
||||
visible: kReleaseMode,
|
||||
child: IconButton(
|
||||
onPressed: () => UnimplementedDialog.show(context),
|
||||
icon: const Icon(Icons.textsms_outlined),
|
||||
subtitle: isSelf
|
||||
? const Text("Du")
|
||||
: e.actorType == GetReactionsResponseObjectActorType.guests ? const Text("Gast") : null,
|
||||
trailing: isSelf
|
||||
? null
|
||||
: Visibility(
|
||||
visible: kReleaseMode,
|
||||
child: IconButton(
|
||||
onPressed: () => UnimplementedDialog.show(context),
|
||||
icon: const Icon(Icons.textsms_outlined),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
);
|
||||
|
20
lib/widget/userAvatar.dart
Normal file
20
lib/widget/userAvatar.dart
Normal file
@ -0,0 +1,20 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../model/endpointData.dart';
|
||||
|
||||
class UserAvatar extends StatelessWidget {
|
||||
final String username;
|
||||
final bool isGroup;
|
||||
const UserAvatar({required this.username, this.isGroup = false, super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CircleAvatar(
|
||||
foregroundImage: !isGroup ? Image.network("https://${EndpointData().nextcloud().full()}/avatar/$username/128").image : null,
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
foregroundColor: Colors.white,
|
||||
onForegroundImageError: !isGroup ? (o, t) {} : null,
|
||||
child: isGroup ? const Icon(Icons.group) : const Icon(Icons.person),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user